From 366d2efcd05324e61fcbad1aa56a70b131b345ea Mon Sep 17 00:00:00 2001 From: Vasily Pyatykh Date: Tue, 13 Jun 2023 20:14:06 +0800 Subject: [PATCH 01/70] fix typos: "assymetric" -> asymmetric (#660) --- src/Faker/Provider/en_US/Company.php | 2 +- src/Faker/Provider/es_AR/Company.php | 2 +- src/Faker/Provider/es_ES/Company.php | 2 +- src/Faker/Provider/es_PE/Company.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Faker/Provider/en_US/Company.php b/src/Faker/Provider/en_US/Company.php index ee72fca993..8cab28a95e 100644 --- a/src/Faker/Provider/en_US/Company.php +++ b/src/Faker/Provider/en_US/Company.php @@ -15,7 +15,7 @@ class Company extends \Faker\Provider\Company 'Adaptive', 'Advanced', 'Ameliorated', 'Assimilated', 'Automated', 'Balanced', 'Business-focused', 'Centralized', 'Cloned', 'Compatible', 'Configurable', 'Cross-group', 'Cross-platform', 'Customer-focused', 'Customizable', 'Decentralized', 'De-engineered', 'Devolved', 'Digitized', 'Distributed', 'Diverse', 'Down-sized', 'Enhanced', 'Enterprise-wide', 'Ergonomic', 'Exclusive', 'Expanded', 'Extended', 'Facetoface', 'Focused', 'Front-line', 'Fully-configurable', 'Function-based', 'Fundamental', 'Future-proofed', 'Grass-roots', 'Horizontal', 'Implemented', 'Innovative', 'Integrated', 'Intuitive', 'Inverse', 'Managed', 'Mandatory', 'Monitored', 'Multi-channelled', 'Multi-lateral', 'Multi-layered', 'Multi-tiered', 'Networked', 'Object-based', 'Open-architected', 'Open-source', 'Operative', 'Optimized', 'Optional', 'Organic', 'Organized', 'Persevering', 'Persistent', 'Phased', 'Polarised', 'Pre-emptive', 'Proactive', 'Profit-focused', 'Profound', 'Programmable', 'Progressive', 'Public-key', 'Quality-focused', 'Reactive', 'Realigned', 'Re-contextualized', 'Re-engineered', 'Reduced', 'Reverse-engineered', 'Right-sized', 'Robust', 'Seamless', 'Secured', 'Self-enabling', 'Sharable', 'Stand-alone', 'Streamlined', 'Switchable', 'Synchronised', 'Synergistic', 'Synergized', 'Team-oriented', 'Total', 'Triple-buffered', 'Universal', 'Up-sized', 'Upgradable', 'User-centric', 'User-friendly', 'Versatile', 'Virtual', 'Visionary', 'Vision-oriented', ], [ - '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'assymetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', + '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'asymmetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', ], [ 'ability', 'access', 'adapter', 'algorithm', 'alliance', 'analyzer', 'application', 'approach', 'architecture', 'archive', 'artificialintelligence', 'array', 'attitude', 'benchmark', 'blockchain', 'budgetarymanagement', 'capability', 'capacity', 'challenge', 'circuit', 'collaboration', 'complexity', 'concept', 'conglomeration', 'contingency', 'core', 'customerloyalty', 'database', 'data-warehouse', 'definition', 'emulation', 'encoding', 'encryption', 'extranet', 'firmware', 'flexibility', 'focusgroup', 'forecast', 'frame', 'framework', 'function', 'functionalities', 'GraphicInterface', 'groupware', 'GraphicalUserInterface', 'hardware', 'help-desk', 'hierarchy', 'hub', 'implementation', 'info-mediaries', 'infrastructure', 'initiative', 'installation', 'instructionset', 'interface', 'internetsolution', 'intranet', 'knowledgeuser', 'knowledgebase', 'localareanetwork', 'leverage', 'matrices', 'matrix', 'methodology', 'middleware', 'migration', 'model', 'moderator', 'monitoring', 'moratorium', 'neural-net', 'openarchitecture', 'opensystem', 'orchestration', 'paradigm', 'parallelism', 'policy', 'portal', 'pricingstructure', 'processimprovement', 'product', 'productivity', 'project', 'projection', 'protocol', 'securedline', 'service-desk', 'software', 'solution', 'standardization', 'strategy', 'structure', 'success', 'superstructure', 'support', 'synergy', 'systemengine', 'task-force', 'throughput', 'time-frame', 'toolset', 'utilisation', 'website', 'workforce', diff --git a/src/Faker/Provider/es_AR/Company.php b/src/Faker/Provider/es_AR/Company.php index f14d446716..bc6211cdfa 100644 --- a/src/Faker/Provider/es_AR/Company.php +++ b/src/Faker/Provider/es_AR/Company.php @@ -17,7 +17,7 @@ class Company extends \Faker\Provider\Company 'Adaptive', 'Advanced', 'Ameliorated', 'Assimilated', 'Automated', 'Balanced', 'Business-focused', 'Centralized', 'Cloned', 'Compatible', 'Configurable', 'Cross-group', 'Cross-platform', 'Customer-focused', 'Customizable', 'Decentralized', 'De-engineered', 'Devolved', 'Digitized', 'Distributed', 'Diverse', 'Down-sized', 'Enhanced', 'Enterprise-wide', 'Ergonomic', 'Exclusive', 'Expanded', 'Extended', 'Facetoface', 'Focused', 'Front-line', 'Fully-configurable', 'Function-based', 'Fundamental', 'Future-proofed', 'Grass-roots', 'Horizontal', 'Implemented', 'Innovative', 'Integrated', 'Intuitive', 'Inverse', 'Managed', 'Mandatory', 'Monitored', 'Multi-channelled', 'Multi-lateral', 'Multi-layered', 'Multi-tiered', 'Networked', 'Object-based', 'Open-architected', 'Open-source', 'Operative', 'Optimized', 'Optional', 'Organic', 'Organized', 'Persevering', 'Persistent', 'Phased', 'Polarised', 'Pre-emptive', 'Proactive', 'Profit-focused', 'Profound', 'Programmable', 'Progressive', 'Public-key', 'Quality-focused', 'Reactive', 'Realigned', 'Re-contextualized', 'Re-engineered', 'Reduced', 'Reverse-engineered', 'Right-sized', 'Robust', 'Seamless', 'Secured', 'Self-enabling', 'Sharable', 'Stand-alone', 'Streamlined', 'Switchable', 'Synchronised', 'Synergistic', 'Synergized', 'Team-oriented', 'Total', 'Triple-buffered', 'Universal', 'Up-sized', 'Upgradable', 'User-centric', 'User-friendly', 'Versatile', 'Virtual', 'Visionary', 'Vision-oriented', ], [ - '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'assymetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', + '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'asymmetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', ], [ 'ability', 'access', 'adapter', 'algorithm', 'alliance', 'analyzer', 'application', 'approach', 'architecture', 'archive', 'artificialintelligence', 'array', 'attitude', 'benchmark', 'budgetarymanagement', 'capability', 'capacity', 'challenge', 'circuit', 'collaboration', 'complexity', 'concept', 'conglomeration', 'contingency', 'core', 'customerloyalty', 'database', 'data-warehouse', 'definition', 'emulation', 'encoding', 'encryption', 'extranet', 'firmware', 'flexibility', 'focusgroup', 'forecast', 'frame', 'framework', 'function', 'functionalities', 'GraphicInterface', 'groupware', 'GraphicalUserInterface', 'hardware', 'help-desk', 'hierarchy', 'hub', 'implementation', 'info-mediaries', 'infrastructure', 'initiative', 'installation', 'instructionset', 'interface', 'internetsolution', 'intranet', 'knowledgeuser', 'knowledgebase', 'localareanetwork', 'leverage', 'matrices', 'matrix', 'methodology', 'middleware', 'migration', 'model', 'moderator', 'monitoring', 'moratorium', 'neural-net', 'openarchitecture', 'opensystem', 'orchestration', 'paradigm', 'parallelism', 'policy', 'portal', 'pricingstructure', 'processimprovement', 'product', 'productivity', 'project', 'projection', 'protocol', 'securedline', 'service-desk', 'software', 'solution', 'standardization', 'strategy', 'structure', 'success', 'superstructure', 'support', 'synergy', 'systemengine', 'task-force', 'throughput', 'time-frame', 'toolset', 'utilisation', 'website', 'workforce', diff --git a/src/Faker/Provider/es_ES/Company.php b/src/Faker/Provider/es_ES/Company.php index 73bd3159b2..5d6dafecc2 100644 --- a/src/Faker/Provider/es_ES/Company.php +++ b/src/Faker/Provider/es_ES/Company.php @@ -22,7 +22,7 @@ class Company extends \Faker\Provider\Company 'Adaptive', 'Advanced', 'Ameliorated', 'Assimilated', 'Automated', 'Balanced', 'Business-focused', 'Centralized', 'Cloned', 'Compatible', 'Configurable', 'Cross-group', 'Cross-platform', 'Customer-focused', 'Customizable', 'Decentralized', 'De-engineered', 'Devolved', 'Digitized', 'Distributed', 'Diverse', 'Down-sized', 'Enhanced', 'Enterprise-wide', 'Ergonomic', 'Exclusive', 'Expanded', 'Extended', 'Facetoface', 'Focused', 'Front-line', 'Fully-configurable', 'Function-based', 'Fundamental', 'Future-proofed', 'Grass-roots', 'Horizontal', 'Implemented', 'Innovative', 'Integrated', 'Intuitive', 'Inverse', 'Managed', 'Mandatory', 'Monitored', 'Multi-channelled', 'Multi-lateral', 'Multi-layered', 'Multi-tiered', 'Networked', 'Object-based', 'Open-architected', 'Open-source', 'Operative', 'Optimized', 'Optional', 'Organic', 'Organized', 'Persevering', 'Persistent', 'Phased', 'Polarised', 'Pre-emptive', 'Proactive', 'Profit-focused', 'Profound', 'Programmable', 'Progressive', 'Public-key', 'Quality-focused', 'Reactive', 'Realigned', 'Re-contextualized', 'Re-engineered', 'Reduced', 'Reverse-engineered', 'Right-sized', 'Robust', 'Seamless', 'Secured', 'Self-enabling', 'Sharable', 'Stand-alone', 'Streamlined', 'Switchable', 'Synchronised', 'Synergistic', 'Synergized', 'Team-oriented', 'Total', 'Triple-buffered', 'Universal', 'Up-sized', 'Upgradable', 'User-centric', 'User-friendly', 'Versatile', 'Virtual', 'Visionary', 'Vision-oriented', ], [ - '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'assymetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', + '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'asymmetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', ], [ 'ability', 'access', 'adapter', 'algorithm', 'alliance', 'analyzer', 'application', 'approach', 'architecture', 'archive', 'artificialintelligence', 'array', 'attitude', 'benchmark', 'budgetarymanagement', 'capability', 'capacity', 'challenge', 'circuit', 'collaboration', 'complexity', 'concept', 'conglomeration', 'contingency', 'core', 'customerloyalty', 'database', 'data-warehouse', 'definition', 'emulation', 'encoding', 'encryption', 'extranet', 'firmware', 'flexibility', 'focusgroup', 'forecast', 'frame', 'framework', 'function', 'functionalities', 'GraphicInterface', 'groupware', 'GraphicalUserInterface', 'hardware', 'help-desk', 'hierarchy', 'hub', 'implementation', 'info-mediaries', 'infrastructure', 'initiative', 'installation', 'instructionset', 'interface', 'internetsolution', 'intranet', 'knowledgeuser', 'knowledgebase', 'localareanetwork', 'leverage', 'matrices', 'matrix', 'methodology', 'middleware', 'migration', 'model', 'moderator', 'monitoring', 'moratorium', 'neural-net', 'openarchitecture', 'opensystem', 'orchestration', 'paradigm', 'parallelism', 'policy', 'portal', 'pricingstructure', 'processimprovement', 'product', 'productivity', 'project', 'projection', 'protocol', 'securedline', 'service-desk', 'software', 'solution', 'standardization', 'strategy', 'structure', 'success', 'superstructure', 'support', 'synergy', 'systemengine', 'task-force', 'throughput', 'time-frame', 'toolset', 'utilisation', 'website', 'workforce', diff --git a/src/Faker/Provider/es_PE/Company.php b/src/Faker/Provider/es_PE/Company.php index ff9f50dc11..96a1d13ebd 100644 --- a/src/Faker/Provider/es_PE/Company.php +++ b/src/Faker/Provider/es_PE/Company.php @@ -17,7 +17,7 @@ class Company extends \Faker\Provider\Company 'Adaptive', 'Advanced', 'Ameliorated', 'Assimilated', 'Automated', 'Balanced', 'Business-focused', 'Centralized', 'Cloned', 'Compatible', 'Configurable', 'Cross-group', 'Cross-platform', 'Customer-focused', 'Customizable', 'Decentralized', 'De-engineered', 'Devolved', 'Digitized', 'Distributed', 'Diverse', 'Down-sized', 'Enhanced', 'Enterprise-wide', 'Ergonomic', 'Exclusive', 'Expanded', 'Extended', 'Facetoface', 'Focused', 'Front-line', 'Fully-configurable', 'Function-based', 'Fundamental', 'Future-proofed', 'Grass-roots', 'Horizontal', 'Implemented', 'Innovative', 'Integrated', 'Intuitive', 'Inverse', 'Managed', 'Mandatory', 'Monitored', 'Multi-channelled', 'Multi-lateral', 'Multi-layered', 'Multi-tiered', 'Networked', 'Object-based', 'Open-architected', 'Open-source', 'Operative', 'Optimized', 'Optional', 'Organic', 'Organized', 'Persevering', 'Persistent', 'Phased', 'Polarised', 'Pre-emptive', 'Proactive', 'Profit-focused', 'Profound', 'Programmable', 'Progressive', 'Public-key', 'Quality-focused', 'Reactive', 'Realigned', 'Re-contextualized', 'Re-engineered', 'Reduced', 'Reverse-engineered', 'Right-sized', 'Robust', 'Seamless', 'Secured', 'Self-enabling', 'Sharable', 'Stand-alone', 'Streamlined', 'Switchable', 'Synchronised', 'Synergistic', 'Synergized', 'Team-oriented', 'Total', 'Triple-buffered', 'Universal', 'Up-sized', 'Upgradable', 'User-centric', 'User-friendly', 'Versatile', 'Virtual', 'Visionary', 'Vision-oriented', ], [ - '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'assymetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', + '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'asymmetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', ], [ 'ability', 'access', 'adapter', 'algorithm', 'alliance', 'analyzer', 'application', 'approach', 'architecture', 'archive', 'artificialintelligence', 'array', 'attitude', 'benchmark', 'budgetarymanagement', 'capability', 'capacity', 'challenge', 'circuit', 'collaboration', 'complexity', 'concept', 'conglomeration', 'contingency', 'core', 'customerloyalty', 'database', 'data-warehouse', 'definition', 'emulation', 'encoding', 'encryption', 'extranet', 'firmware', 'flexibility', 'focusgroup', 'forecast', 'frame', 'framework', 'function', 'functionalities', 'GraphicInterface', 'groupware', 'GraphicalUserInterface', 'hardware', 'help-desk', 'hierarchy', 'hub', 'implementation', 'info-mediaries', 'infrastructure', 'initiative', 'installation', 'instructionset', 'interface', 'internetsolution', 'intranet', 'knowledgeuser', 'knowledgebase', 'localareanetwork', 'leverage', 'matrices', 'matrix', 'methodology', 'middleware', 'migration', 'model', 'moderator', 'monitoring', 'moratorium', 'neural-net', 'openarchitecture', 'opensystem', 'orchestration', 'paradigm', 'parallelism', 'policy', 'portal', 'pricingstructure', 'processimprovement', 'product', 'productivity', 'project', 'projection', 'protocol', 'securedline', 'service-desk', 'software', 'solution', 'standardization', 'strategy', 'structure', 'success', 'superstructure', 'support', 'synergy', 'systemengine', 'task-force', 'throughput', 'time-frame', 'toolset', 'utilisation', 'website', 'workforce', From c21a797c618b6611058f6787b9289e9aadb98fe9 Mon Sep 17 00:00:00 2001 From: EdgarsN Date: Wed, 14 Jun 2023 19:09:03 +0300 Subject: [PATCH 02/70] Fix: lv_LV postcode format (#661) * fix lv_LV postcode format * test added --- src/Faker/Provider/lv_LV/Address.php | 2 +- test/Faker/Provider/lv_LV/AddressTest.php | 25 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test/Faker/Provider/lv_LV/AddressTest.php diff --git a/src/Faker/Provider/lv_LV/Address.php b/src/Faker/Provider/lv_LV/Address.php index fc8db5c196..0bddcc53b9 100644 --- a/src/Faker/Provider/lv_LV/Address.php +++ b/src/Faker/Provider/lv_LV/Address.php @@ -12,7 +12,7 @@ class Address extends \Faker\Provider\Address ]; protected static $buildingNumber = ['%#']; - protected static $postcode = ['LV ####']; + protected static $postcode = ['LV-####']; /** * @see https://lv.wikipedia.org/wiki/Suver%C4%93no_valstu_uzskait%C4%ABjums diff --git a/test/Faker/Provider/lv_LV/AddressTest.php b/test/Faker/Provider/lv_LV/AddressTest.php new file mode 100644 index 0000000000..275340516e --- /dev/null +++ b/test/Faker/Provider/lv_LV/AddressTest.php @@ -0,0 +1,25 @@ +faker->postcode(); + self::assertNotEmpty($postcode); + self::assertIsString($postcode); + self::assertMatchesRegularExpression('/LV-\d{4}/', $postcode); + } + + protected function getProviders(): iterable + { + yield new Address($this->faker); + } +} From 2d4ef8ec64863281a813c7b992653b7c164ff0c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Jul 2023 09:57:45 +0200 Subject: [PATCH 03/70] composer(deps): bump vimeo/psalm in /vendor-bin/psalm (#669) Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 5.12.0 to 5.13.1. - [Release notes](https://github.com/vimeo/psalm/releases) - [Commits](https://github.com/vimeo/psalm/compare/5.12.0...5.13.1) --- updated-dependencies: - dependency-name: vimeo/psalm dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor-bin/psalm/composer.json | 2 +- vendor-bin/psalm/composer.lock | 60 ++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json index 58847a5b4b..1b3cd62fb3 100644 --- a/vendor-bin/psalm/composer.json +++ b/vendor-bin/psalm/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^7.4 || ^8.0", - "vimeo/psalm": "^5.12.0" + "vimeo/psalm": "^5.13.1" }, "config": { "platform": { diff --git a/vendor-bin/psalm/composer.lock b/vendor-bin/psalm/composer.lock index dad3d53fce..ea2b3dd065 100644 --- a/vendor-bin/psalm/composer.lock +++ b/vendor-bin/psalm/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "86309fa843bd1716e5cbefe131d15afc", + "content-hash": "37211349afb3a730daadebfce9228beb", "packages": [ { "name": "amphp/amp", @@ -429,25 +429,29 @@ }, { "name": "doctrine/deprecations", - "version": "v1.1.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "8cffffb2218e01f3b370bf763e00e81697725259" + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/8cffffb2218e01f3b370bf763e00e81697725259", - "reference": "8cffffb2218e01f3b370bf763e00e81697725259", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -466,9 +470,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.1.0" + "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" }, - "time": "2023-05-29T18:55:17+00:00" + "time": "2023-06-03T09:27:29+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -685,16 +689,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.5", + "version": "v4.16.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" + "reference": "19526a33fb561ef417e822e85f08a00db4059c17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", + "reference": "19526a33fb561ef417e822e85f08a00db4059c17", "shasum": "" }, "require": { @@ -735,9 +739,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" }, - "time": "2023-05-19T20:20:00+00:00" + "time": "2023-06-25T14:52:30+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1350,16 +1354,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.23", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5" + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", "shasum": "" }, "require": { @@ -1394,7 +1398,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.23" + "source": "https://github.com/symfony/filesystem/tree/v5.4.25" }, "funding": [ { @@ -1410,7 +1414,7 @@ "type": "tidelift" } ], - "time": "2023-03-02T11:38:35+00:00" + "time": "2023-05-31T13:04:02+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2075,16 +2079,16 @@ }, { "name": "vimeo/psalm", - "version": "5.12.0", + "version": "5.13.1", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "f90118cdeacd0088e7215e64c0c99ceca819e176" + "reference": "086b94371304750d1c673315321a55d15fc59015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/f90118cdeacd0088e7215e64c0c99ceca819e176", - "reference": "f90118cdeacd0088e7215e64c0c99ceca819e176", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/086b94371304750d1c673315321a55d15fc59015", + "reference": "086b94371304750d1c673315321a55d15fc59015", "shasum": "" }, "require": { @@ -2175,9 +2179,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.12.0" + "source": "https://github.com/vimeo/psalm/tree/5.13.1" }, - "time": "2023-05-22T21:19:03+00:00" + "time": "2023-06-27T16:39:49+00:00" }, { "name": "webmozart/assert", From 6637e5a58d959e5c290c2d79e967da244d23912f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Jul 2023 09:58:05 +0200 Subject: [PATCH 04/70] composer(deps): bump rector/rector in /vendor-bin/rector (#667) Bumps [rector/rector](https://github.com/rectorphp/rector) from 0.17.0 to 0.17.2. - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](https://github.com/rectorphp/rector/compare/0.17.0...0.17.2) --- updated-dependencies: - dependency-name: rector/rector dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor-bin/rector/composer.json | 2 +- vendor-bin/rector/composer.lock | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/vendor-bin/rector/composer.json b/vendor-bin/rector/composer.json index 2f7ecbbd57..176d5e8265 100644 --- a/vendor-bin/rector/composer.json +++ b/vendor-bin/rector/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^8.1", - "rector/rector": "^0.17.0" + "rector/rector": "^0.17.2" }, "config": { "platform": { diff --git a/vendor-bin/rector/composer.lock b/vendor-bin/rector/composer.lock index a9e8a017ac..b0e8881b4e 100644 --- a/vendor-bin/rector/composer.lock +++ b/vendor-bin/rector/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "96df4562e61b7e6a3e8f8a2651ffb449", + "content-hash": "3dd80c93457ab30710aed15359aecad9", "packages": [ { "name": "phpstan/phpstan", - "version": "1.10.15", + "version": "1.10.22", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd" + "reference": "97d694dfd4ceb57bcce4e3b38548f13ea62e4287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/762c4dac4da6f8756eebb80e528c3a47855da9bd", - "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/97d694dfd4ceb57bcce4e3b38548f13ea62e4287", + "reference": "97d694dfd4ceb57bcce4e3b38548f13ea62e4287", "shasum": "" }, "require": { @@ -66,25 +66,25 @@ "type": "tidelift" } ], - "time": "2023-05-09T15:28:01+00:00" + "time": "2023-06-30T20:04:11+00:00" }, { "name": "rector/rector", - "version": "0.17.0", + "version": "0.17.2", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "d8da002b107c9b64d464bb48101290d4d078df4b" + "reference": "b8f72ff7e4914bb1d1557cc5c6d33898f7fd2bfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/d8da002b107c9b64d464bb48101290d4d078df4b", - "reference": "d8da002b107c9b64d464bb48101290d4d078df4b", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/b8f72ff7e4914bb1d1557cc5c6d33898f7fd2bfb", + "reference": "b8f72ff7e4914bb1d1557cc5c6d33898f7fd2bfb", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.15" + "phpstan/phpstan": "^1.10.20" }, "conflict": { "rector/rector-doctrine": "*", @@ -119,7 +119,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.17.0" + "source": "https://github.com/rectorphp/rector/tree/0.17.2" }, "funding": [ { @@ -127,7 +127,7 @@ "type": "github" } ], - "time": "2023-06-01T09:42:59+00:00" + "time": "2023-06-29T10:03:28+00:00" } ], "packages-dev": [], From d08588de89e45bd16adcaeeb6d40449f2b89ea79 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Jul 2023 10:00:23 +0200 Subject: [PATCH 05/70] composer(deps): bump phpstan/phpstan in /vendor-bin/phpstan (#666) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.15 to 1.10.22. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.10.15...1.10.22) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor-bin/phpstan/composer.json | 2 +- vendor-bin/phpstan/composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index 71db14b9d9..a56f4245a5 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -2,7 +2,7 @@ "require": { "php": "^7.4 || ^8.0", "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.10.15", + "phpstan/phpstan": "^1.10.22", "phpstan/phpstan-deprecation-rules": "^1.1.3" }, "config": { diff --git a/vendor-bin/phpstan/composer.lock b/vendor-bin/phpstan/composer.lock index 0d551fc48a..b9cebef88a 100644 --- a/vendor-bin/phpstan/composer.lock +++ b/vendor-bin/phpstan/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "138df2ef452a08862d974f139e444db0", + "content-hash": "863043782a582fdfd295bb0a0cd51c08", "packages": [ { "name": "phpstan/extension-installer", @@ -52,16 +52,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.15", + "version": "1.10.22", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd" + "reference": "97d694dfd4ceb57bcce4e3b38548f13ea62e4287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/762c4dac4da6f8756eebb80e528c3a47855da9bd", - "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/97d694dfd4ceb57bcce4e3b38548f13ea62e4287", + "reference": "97d694dfd4ceb57bcce4e3b38548f13ea62e4287", "shasum": "" }, "require": { @@ -110,7 +110,7 @@ "type": "tidelift" } ], - "time": "2023-05-09T15:28:01+00:00" + "time": "2023-06-30T20:04:11+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", From 5c1e5005cc0b11143e535ed50c965e58a46225b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Jul 2023 10:09:21 +0200 Subject: [PATCH 06/70] composer(deps): bump friendsofphp/php-cs-fixer from 3.17.0 to 3.20.0 in /vendor-bin/php-cs-fixer (#668) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * composer(deps): bump friendsofphp/php-cs-fixer Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.17.0 to 3.20.0. - [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases) - [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md) - [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.17.0...v3.20.0) --- updated-dependencies: - dependency-name: friendsofphp/php-cs-fixer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix: Run 'make cs' * Fix: Whitespace * Enhancement: Configure blank_lines_before_namespace instead of deprecated single_blank_line_before_namespace fixer --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andreas Möller --- .php-cs-fixer.dist.php | 5 ++- src/Faker/Provider/nl_BE/Person.php | 14 +++---- src/Faker/Provider/pt_BR/Text.php | 56 +++++++++++++-------------- vendor-bin/php-cs-fixer/composer.json | 2 +- vendor-bin/php-cs-fixer/composer.lock | 48 ++++++++++++----------- 5 files changed, 66 insertions(+), 59 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index ff9a013169..90a8d4feb8 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -54,6 +54,10 @@ 'yield', ], ], + 'blank_lines_before_namespace' => [ + 'max_line_breaks' => 2, + 'min_line_breaks' => 2, + ], 'cast_spaces' => true, 'class_attributes_separation' => [ 'elements' => [ @@ -186,7 +190,6 @@ 'return_type_declaration' => true, 'semicolon_after_instruction' => true, 'short_scalar_cast' => true, - 'single_blank_line_before_namespace' => true, 'single_line_comment_style' => true, 'single_quote' => true, 'single_space_around_construct' => [ diff --git a/src/Faker/Provider/nl_BE/Person.php b/src/Faker/Provider/nl_BE/Person.php index f4a60f96b4..55d6f18eaa 100644 --- a/src/Faker/Provider/nl_BE/Person.php +++ b/src/Faker/Provider/nl_BE/Person.php @@ -73,17 +73,17 @@ class Person extends \Faker\Provider\Person ]; /** - * Belgian Rijksregister numbers are used to identify each citizen, - * it consists of three parts, the person's day of birth, in the - * format 'ymd', followed by a number between 1 and 997, odd for - * males, even for females. The last part is used to check if it's - * a valid number. + * Belgian Rijksregister numbers are used to identify each citizen, + * it consists of three parts, the person's day of birth, in the + * format 'ymd', followed by a number between 1 and 997, odd for + * males, even for females. The last part is used to check if it's + * a valid number. * * @see https://nl.wikipedia.org/wiki/Rijksregisternummer * - * @param string|null $gender 'male', 'female' or null for any + * @param string|null $gender 'male', 'female' or null for any * - * @return string + * @return string */ public static function rrn($gender = null) { diff --git a/src/Faker/Provider/pt_BR/Text.php b/src/Faker/Provider/pt_BR/Text.php index d177c8725c..ce60728557 100644 --- a/src/Faker/Provider/pt_BR/Text.php +++ b/src/Faker/Provider/pt_BR/Text.php @@ -5,52 +5,52 @@ class Text extends \Faker\Provider\Text { /** - * The Project Gutenberg EBook of Dom Casmurro, by Machado de Assis + * The Project Gutenberg EBook of Dom Casmurro, by Machado de Assis * - * This eBook is for the use of anyone anywhere in the United States and most - * other parts of the world at no cost and with almost no restrictions - * whatsoever. You may copy it, give it away or re-use it under the terms of - * the Project Gutenberg License included with this eBook or online at - * www.gutenberg.org. If you are not located in the United States, you'll have - * to check the laws of the country where you are located before using this ebook. + * This eBook is for the use of anyone anywhere in the United States and most + * other parts of the world at no cost and with almost no restrictions + * whatsoever. You may copy it, give it away or re-use it under the terms of + * the Project Gutenberg License included with this eBook or online at + * www.gutenberg.org. If you are not located in the United States, you'll have + * to check the laws of the country where you are located before using this ebook. * - * Title: Dom Casmurro + * Title: Dom Casmurro * - * Author: Machado de Assis + * Author: Machado de Assis * - * Release Date: October 15, 2017 [EBook #55752] + * Release Date: October 15, 2017 [EBook #55752] * - * Language: Portuguese + * Language: Portuguese * - * *** START OF THIS PROJECT GUTENBERG EBOOK DOM CASMURRO *** + * *** START OF THIS PROJECT GUTENBERG EBOOK DOM CASMURRO *** * - * Produced by Laura Natal Rodriguez & Marc D'Hooghe at Free - * Literature (online soon in an extended version,also linking - * to free sources for education worldwide ... MOOC's, - * educational materials,...) (Images generously made available - * by the Bibliotheca Nacional Digital Brasil.) + * Produced by Laura Natal Rodriguez & Marc D'Hooghe at Free + * Literature (online soon in an extended version,also linking + * to free sources for education worldwide ... MOOC's, + * educational materials,...) (Images generously made available + * by the Bibliotheca Nacional Digital Brasil.) * - * DOM CASMURRO + * DOM CASMURRO * - * POR + * POR * - * MACHADO DE ASSIS + * MACHADO DE ASSIS * - * DA ACADEMIA BRAZILEIRA + * DA ACADEMIA BRAZILEIRA * - * H. GARNIER, LIVREIRO-EDITOR + * H. GARNIER, LIVREIRO-EDITOR * - * RUA MOREIRA CEZAR, 71 + * RUA MOREIRA CEZAR, 71 * - * RIO DE JANEIRO + * RIO DE JANEIRO * - * 6, RUE DES SAINTS-PÈRES, 6 + * 6, RUE DES SAINTS-PÈRES, 6 * - * PARIZ + * PARIZ * - * @see https://www.gutenberg.org/cache/epub/55752/pg55752.txt + * @see https://www.gutenberg.org/cache/epub/55752/pg55752.txt * - * @var string + * @var string */ protected static $baseText = <<<'EOT' I diff --git a/vendor-bin/php-cs-fixer/composer.json b/vendor-bin/php-cs-fixer/composer.json index af0aa10dcb..b49e67eb2b 100644 --- a/vendor-bin/php-cs-fixer/composer.json +++ b/vendor-bin/php-cs-fixer/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^7.4 || ^8.0", - "friendsofphp/php-cs-fixer": "^3.17.0" + "friendsofphp/php-cs-fixer": "^3.20.0" }, "config": { "platform": { diff --git a/vendor-bin/php-cs-fixer/composer.lock b/vendor-bin/php-cs-fixer/composer.lock index 397e34ea19..8abed99b19 100644 --- a/vendor-bin/php-cs-fixer/composer.lock +++ b/vendor-bin/php-cs-fixer/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8ce14ad433ee930efb2f4371a3c7024f", + "content-hash": "9950cb32653c494c4cd0bf260df0453e", "packages": [ { "name": "composer/pcre", @@ -302,25 +302,29 @@ }, { "name": "doctrine/deprecations", - "version": "v1.1.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "8cffffb2218e01f3b370bf763e00e81697725259" + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/8cffffb2218e01f3b370bf763e00e81697725259", - "reference": "8cffffb2218e01f3b370bf763e00e81697725259", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -339,9 +343,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.1.0" + "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" }, - "time": "2023-05-29T18:55:17+00:00" + "time": "2023-06-03T09:27:29+00:00" }, { "name": "doctrine/lexer", @@ -423,16 +427,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.17.0", + "version": "v3.20.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "3f0ed862f22386c55a767461ef5083bddceeed79" + "reference": "0e8249e0b15e2bc022fbbd1090ce29d071481e69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/3f0ed862f22386c55a767461ef5083bddceeed79", - "reference": "3f0ed862f22386c55a767461ef5083bddceeed79", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/0e8249e0b15e2bc022fbbd1090ce29d071481e69", + "reference": "0e8249e0b15e2bc022fbbd1090ce29d071481e69", "shasum": "" }, "require": { @@ -507,7 +511,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.17.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.20.0" }, "funding": [ { @@ -515,7 +519,7 @@ "type": "github" } ], - "time": "2023-05-22T19:59:32+00:00" + "time": "2023-06-27T20:22:39+00:00" }, { "name": "psr/cache", @@ -1112,16 +1116,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.23", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5" + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", "shasum": "" }, "require": { @@ -1156,7 +1160,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.23" + "source": "https://github.com/symfony/filesystem/tree/v5.4.25" }, "funding": [ { @@ -1172,7 +1176,7 @@ "type": "tidelift" } ], - "time": "2023-03-02T11:38:35+00:00" + "time": "2023-05-31T13:04:02+00:00" }, { "name": "symfony/finder", From 35bddf23e27db8978d079fa5cf6bd414cdea42dc Mon Sep 17 00:00:00 2001 From: Nikolas Evers Date: Thu, 6 Jul 2023 08:40:21 +0200 Subject: [PATCH 07/70] Add `$format` to `image` DocBlock (#670) --- src/Faker/Generator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faker/Generator.php b/src/Faker/Generator.php index 2cad02d7a8..225e8e5313 100644 --- a/src/Faker/Generator.php +++ b/src/Faker/Generator.php @@ -279,7 +279,7 @@ * * @property string $image * - * @method string image($dir = null, $width = 640, $height = 480, $category = null, $fullPath = true, $randomize = true, $word = null, $gray = false) + * @method string image($dir = null, $width = 640, $height = 480, $category = null, $fullPath = true, $randomize = true, $word = null, $gray = false, string $format = 'png') * * @property string $email * From 05bc4defd822512913afc209372f4f769bbfc0e8 Mon Sep 17 00:00:00 2001 From: EdgarsN Date: Sun, 9 Jul 2023 09:22:21 +0300 Subject: [PATCH 08/70] Fix: lv_LV generating invalid personal identity numbers (#663) --- src/Faker/Provider/lv_LV/Person.php | 28 +++++++++++++++--- test/Faker/Provider/lv_LV/PersonTest.php | 37 ++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 test/Faker/Provider/lv_LV/PersonTest.php diff --git a/src/Faker/Provider/lv_LV/Person.php b/src/Faker/Provider/lv_LV/Person.php index d251f891a6..4e9b93b75d 100644 --- a/src/Faker/Provider/lv_LV/Person.php +++ b/src/Faker/Provider/lv_LV/Person.php @@ -2,7 +2,6 @@ namespace Faker\Provider\lv_LV; -use Faker\Calculator\Luhn; use Faker\Provider\DateTime; class Person extends \Faker\Provider\Person @@ -145,11 +144,32 @@ public function personalIdentityNumber(\DateTime $birthdate = null) $birthdate = DateTime::dateTimeThisCentury(); } + $year = $birthdate->format('Y'); + + if ($year >= 2000 && $year <= 2099) { + $century = 2; + } elseif ($year >= 1900 && $year <= 1999) { + $century = 1; + } else { + $century = 0; + } + $datePart = $birthdate->format('dmy'); - $randomDigits = (string) static::numerify('####'); + $serialNumber = static::numerify('###'); + + $partialNumberSplit = str_split($datePart . $century . $serialNumber); + + $idDigitValidator = [1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; + $total = 0; + + foreach ($partialNumberSplit as $key => $digit) { + if (isset($idDigitValidator[$key])) { + $total += $idDigitValidator[$key] * (int) $digit; + } + } - $checksum = Luhn::computeCheckDigit($datePart . $randomDigits); + $checksumDigit = (1101 - $total) % 11 % 10; - return $datePart . '-' . $randomDigits . $checksum; + return $datePart . '-' . $century . $serialNumber . $checksumDigit; } } diff --git a/test/Faker/Provider/lv_LV/PersonTest.php b/test/Faker/Provider/lv_LV/PersonTest.php new file mode 100644 index 0000000000..94a3a05365 --- /dev/null +++ b/test/Faker/Provider/lv_LV/PersonTest.php @@ -0,0 +1,37 @@ +faker->personalIdentityNumber(); + + self::assertMatchesRegularExpression('/^[0-9]{6}-[0-9]{5}$/', $idNumber); + } + + public function testChecksumDigitCalculation(): void + { + $idNumber = $this->faker->personalIdentityNumber(\DateTime::createFromFormat('Y-m-d', '1981-05-24')); + + $serialNumber = substr($idNumber, 8, 3); + $serialNumberSplit = str_split($serialNumber); + + // calculate checksum, using static digits from date (2 4 0 5 8 1 1) and inserting random serial number digits + $checksumDigit = (1101 - (1 * 2 + 6 * 4 + 3 * 0 + 7 * 5 + 9 * 8 + 10 * 1 + 5 * 1 + 8 * (int) $serialNumberSplit[0] + 4 * (int) $serialNumberSplit[1] + 2 * (int) $serialNumberSplit[2])) % 11 % 10; + + self::assertSame('240581-1' . $serialNumber . $checksumDigit, $idNumber); + } + + protected function getProviders(): iterable + { + yield new Person($this->faker); + } +} From a5f88f759ef348098a9ab27def8d222347c609a7 Mon Sep 17 00:00:00 2001 From: Tomasz Klim Date: Sat, 15 Jul 2023 10:43:43 +0200 Subject: [PATCH 09/70] Fix for polish street names + more polish TLDs (#664) --- src/Faker/Provider/pl_PL/Address.php | 174 +++++++++++++------------- src/Faker/Provider/pl_PL/Internet.php | 2 +- 2 files changed, 86 insertions(+), 90 deletions(-) diff --git a/src/Faker/Provider/pl_PL/Address.php b/src/Faker/Provider/pl_PL/Address.php index ca42cb8c31..a7b01bbb1b 100644 --- a/src/Faker/Provider/pl_PL/Address.php +++ b/src/Faker/Provider/pl_PL/Address.php @@ -99,101 +99,97 @@ class Address extends \Faker\Provider\Address * @see http://www.poczta-polska.pl/ */ protected static $street = [ - '1 Maja', '3 Maja', '11 Listopada', 'Agrestowa', 'Akacjowa', 'Andersa Władysława', 'Armii Krajowej', - 'Asnyka Adama', 'Astrów', 'Azaliowa', 'Baczyńskiego Krzysztofa Kamila', 'Bałtycka', - 'Barlickiego Norberta', 'Batalionów Chłopskich', 'Batorego Stefana', 'Bema Józefa', - 'Bema Józefa', 'Beskidzka', 'Białostocka', 'Bielska', 'Bieszczadzka', 'Błękitna', - 'Boczna', 'Bogusławskiego Wojciecha', 'Bohaterów Westerplatte', 'Bolesława Chrobrego', - 'Bolesława Krzywoustego', 'Borowa', 'Botaniczna', 'Bracka', 'Bratków', 'Broniewskiego Władysława', - 'Brzechwy Jana', 'Brzoskwiniowa', 'Brzozowa', 'Budowlanych', 'Bukowa', 'Bursztynowa', - 'Bydgoska', 'Bytomska', 'Cedrowa', 'Cegielniana', 'Ceglana', 'Chabrowa', 'Chełmońskiego Józefa', - 'Chłodna', 'Chłopska', 'Chmielna', 'Chopina Fryderyka', 'Chorzowska', 'Chrobrego Bolesława', - 'Ciasna', 'Cicha', 'Cieszyńska', 'Cisowa', 'Cmentarna', 'Curie-Skłodowskiej Marii', - 'Czarnieckiego Stefana', 'Czereśniowa', 'Częstochowska', 'Czwartaków', 'Daleka', 'Daszyńskiego Ignacego', - 'Dąbrowskiego Jana Henryka', 'Dąbrowskiego Jarosława', 'Dąbrowskiego Jarosława', - 'Dąbrowskiej Marii', 'Dąbrowszczaków', 'Dąbrówki', 'Dębowa', 'Diamentowa', 'Długa', - 'Długosza Jana', 'Dmowskiego Romana', 'Dobra', 'Dolna', 'Dożynkowa', 'Drzymały Michała', - 'Dubois Stanisława', 'Dworcowa', 'Dworska', 'Działkowa', 'Energetyków', 'Fabryczna', - 'Fałata Juliana', 'Fiołkowa', 'Folwarczna', 'Franciszkańska', 'Francuska', 'Fredry Aleksandra', - 'Gagarina Jurija', 'Gajowa', 'Gałczyńskiego Konstantego Ildefonsa', 'Gdańska', 'Gdyńska', - 'Gliwicka', 'Głogowa', 'Głogowska', 'Głowackiego Bartosza', 'Główna', 'Gminna', 'Gnieźnieńska', - 'Gojawiczyńskiej Poli', 'Gołębia', 'Gościnna', 'Górna', 'Górnicza', 'Górnośląska', - 'Grabowa', 'Graniczna', 'Granitowa', 'Grochowska', 'Grodzka', 'Grota-Roweckiego Stefana', - 'Grottgera Artura', 'Grójecka', 'Grunwaldzka', 'Grzybowa', 'Hallera Józefa', 'Handlowa', - 'Harcerska', 'Hetmańska', 'Hoża', 'Husarska', 'Hutnicza', 'Inżynierska', 'Iwaszkiewicza Jarosława', - 'Jagiellońska', 'Jagiellońskie Os.', 'Jagiełły Władysława', 'Jagodowa', 'Jałowcowa', - 'Jana Pawła II', 'Jana Pawła II Al.', 'Jaracza Stefana', 'Jarzębinowa', 'Jaskółcza', - 'Jasna', 'Jastrzębia', 'Jaśminowa', 'Jaworowa', 'Jerozolimskie Al.', 'Jesienna', 'Jesionowa', - 'Jeżynowa', 'Jodłowa', 'Kalinowa', 'Kaliska', 'Kamienna', 'Karłowicza Mieczysława', - 'Karpacka', 'Kartuska', 'Kasprowicza Jana', 'Kasprzaka Marcina', 'Kasztanowa', 'Kaszubska', - 'Katowicka', 'Kazimierza Wielkiego', 'Kielecka', 'Kilińskiego Jana', 'Kleeberga Franciszka', - 'Klonowa', 'Kłosowa', 'Kochanowskiego Jana', 'Kolberga Oskara', 'Kolejowa', 'Kolorowa', - 'Kołłątaja Hugo', 'Kołłątaja Hugona', 'Kołobrzeska', 'Konarskiego Stanisława', - 'Konopnickiej Marii', 'Konstytucji 3 Maja', 'Konwaliowa', 'Kopalniana', 'Kopernika Mikołaja', - 'Koralowa', 'Korczaka Janusza', 'Korfantego Wojciecha', 'Kosmonautów', 'Kossaka Juliusza', - 'Kosynierów', 'Koszalińska', 'Koszykowa', 'Kościelna', 'Kościuszki Tadeusza', 'Kościuszki Tadeusza Pl.', - 'Kowalska', 'Krakowska', 'Krańcowa', 'Krasickiego Ignacego', 'Krasińskiego Zygmunta', - 'Kraszewskiego Józefa Ignacego', 'Kresowa', 'Kręta', 'Królewska', 'Królowej Jadwigi', - 'Krótka', 'Krucza', 'Kruczkowskiego Leona', 'Krzywa', 'Księżycowa', 'Kujawska', 'Kusocińskiego Janusza', - 'Kwiatkowskiego Eugeniusza', 'Kwiatowa', 'Lawendowa', 'Lazurowa', 'Lechicka', 'Legionów', - 'Legnicka', 'Lelewela Joachima', 'Leszczynowa', 'Leśmiana Bolesława', 'Leśna', 'Letnia', - 'Ligonia Juliusza', 'Liliowa', 'Limanowskiego Bolesława', 'Lipowa', 'Lisia', 'Litewska', - 'Lompy Józefa', 'Lotnicza', 'Lotników', 'Lubelska', 'Ludowa', 'Lwowska', 'Łabędzia', - 'Łagiewnicka', 'Łanowa', 'Łączna', 'Łąkowa', 'Łokietka Władysława', 'Łomżyńska', - 'Łowicka', 'Łódzka', 'Łukasiewicza Ignacego', 'Łużycka', 'Maczka Stanisława', - 'Magazynowa', 'Majowa', 'Makowa', 'Makuszyńskiego Kornela', 'Malczewskiego Jacka', 'Malinowa', - 'Mała', 'Małachowskiego Stanisława', 'Małopolska', 'Marszałkowska', 'Matejki Jana', - 'Mazowiecka', 'Mazurska', 'Miarki Karola', 'Mickiewicza Adama', 'Miedziana', 'Mieszka I', - 'Miła', 'Miodowa', 'Młynarska', 'Młyńska', 'Modlińska', 'Modra', 'Modrzejewskiej Heleny', - 'Modrzewiowa', 'Mokra', 'Moniuszki Stanisława', 'Morcinka Gustawa', 'Morelowa', 'Morska', - 'Mostowa', 'Myśliwska', 'Nadbrzeżna', 'Nadrzeczna', 'Nałkowskiej Zofii', 'Narutowicza Gabriela', - 'Niecała', 'Niedziałkowskiego Mieczysława', 'Niemcewicza Juliana Ursyna', 'Niepodległości', - 'Niepodległości Al.', 'Niska', 'Norwida Cypriana Kamila', 'Nowa', 'Nowowiejska', 'Nowowiejskiego Feliksa', + '1 Maja', '3 Maja', '11 Listopada', 'Agrestowa', 'Akacjowa', 'Andersa', 'Armii Krajowej', + 'Asnyka', 'Astrów', 'Azaliowa', 'Baczyńskiego', 'Bałtycka', 'Barlickiego', 'Batalionów Chłopskich', + 'Batorego', 'Bema', 'Beskidzka', 'Białostocka', 'Bielska', 'Bieszczadzka', 'Błękitna', + 'Boczna', 'Bogusławskiego', 'Bohaterów Westerplatte', 'Bolesława Chrobrego', + 'Bolesława Krzywoustego', 'Borowa', 'Botaniczna', 'Bracka', 'Bratków', 'Broniewskiego', + 'Brzechwy', 'Brzoskwiniowa', 'Brzozowa', 'Budowlanych', 'Bukowa', 'Bursztynowa', + 'Bydgoska', 'Bytomska', 'Cedrowa', 'Cegielniana', 'Ceglana', 'Chabrowa', 'Chełmońskiego', + 'Chłodna', 'Chłopska', 'Chmielna', 'Chopina Fryderyka', 'Chorzowska', + 'Ciasna', 'Cicha', 'Cieszyńska', 'Cisowa', 'Cmentarna', 'Curie-Skłodowskiej', + 'Czarnieckiego', 'Czereśniowa', 'Częstochowska', 'Czwartaków', 'Daleka', 'Daszyńskiego', + 'Dąbrowskiego', 'Dąbrowskiej', 'Dąbrowszczaków', 'Dąbrówki', 'Dębowa', 'Diamentowa', 'Długa', + 'Długosza', 'Dmowskiego', 'Dobra', 'Dolna', 'Dożynkowa', 'Drzymały', + 'Dworcowa', 'Dworska', 'Działkowa', 'Energetyków', 'Fabryczna', + 'Fałata', 'Fiołkowa', 'Folwarczna', 'Franciszkańska', 'Francuska', 'Fredry', + 'Gagarina', 'Gajowa', 'Gałczyńskiego', 'Gdańska', 'Gdyńska', + 'Gliwicka', 'Głogowa', 'Głogowska', 'Głowackiego', 'Główna', 'Gminna', 'Gnieźnieńska', + 'Gojawiczyńskiej', 'Gołębia', 'Gościnna', 'Górna', 'Górnicza', 'Górnośląska', + 'Grabowa', 'Graniczna', 'Granitowa', 'Grochowska', 'Grodzka', 'Grota-Roweckiego', + 'Grottgera', 'Grójecka', 'Grunwaldzka', 'Grzybowa', 'Hallera', 'Handlowa', + 'Harcerska', 'Hetmańska', 'Hoża', 'Husarska', 'Hutnicza', 'Inżynierska', 'Iwaszkiewicza', + 'Jagiellońska', 'Os. Jagiellońskie', 'Jagiełły', 'Jagodowa', 'Jałowcowa', + 'Jana Pawła II', 'Al. Jana Pawła II', 'Jaracza', 'Jarzębinowa', 'Jaskółcza', + 'Jasna', 'Jastrzębia', 'Jaśminowa', 'Jaworowa', 'Al. Jerozolimskie', 'Jesienna', 'Jesionowa', + 'Jeżynowa', 'Jodłowa', 'Kalinowa', 'Kaliska', 'Kamienna', 'Karłowicza', + 'Karpacka', 'Kartuska', 'Kasprowicza', 'Kasprzaka Marcina', 'Kasztanowa', 'Kaszubska', + 'Katowicka', 'Kazimierza Wielkiego', 'Kielecka', 'Kilińskiego', 'Kleeberga', + 'Klonowa', 'Kłosowa', 'Kochanowskiego', 'Kolberga', 'Kolejowa', 'Kolorowa', + 'Kołłątaja', 'Kołobrzeska', 'Konarskiego', + 'Konopnickiej', 'Konstytucji 3 Maja', 'Konwaliowa', 'Kopalniana', 'Kopernika', + 'Koralowa', 'Korczaka', 'Korfantego', 'Kosmonautów', 'Kossaka', + 'Kosynierów', 'Koszalińska', 'Koszykowa', 'Kościelna', 'Kościuszki', 'Pl. Kościuszki', + 'Kowalska', 'Krakowska', 'Krańcowa', 'Krasickiego', 'Krasińskiego', + 'Kraszewskiego', 'Kresowa', 'Kręta', 'Królewska', 'Królowej Jadwigi', + 'Krótka', 'Krucza', 'Kruczkowskiego', 'Krzywa', 'Księżycowa', 'Kujawska', 'Kusocińskiego', + 'Kwiatkowskiego', 'Kwiatowa', 'Lawendowa', 'Lazurowa', 'Lechicka', 'Legionów', + 'Legnicka', 'Lelewela', 'Leszczynowa', 'Leśmiana', 'Leśna', 'Letnia', + 'Ligonia', 'Liliowa', 'Limanowskiego', 'Lipowa', 'Lisia', 'Litewska', + 'Lompy', 'Lotnicza', 'Lotników', 'Lubelska', 'Ludowa', 'Lwowska', 'Łabędzia', + 'Łagiewnicka', 'Łanowa', 'Łączna', 'Łąkowa', 'Łokietka', 'Łomżyńska', + 'Łowicka', 'Łódzka', 'Łukasiewicza', 'Łużycka', 'Maczka', + 'Magazynowa', 'Majowa', 'Makowa', 'Makuszyńskiego', 'Malczewskiego', 'Malinowa', + 'Mała', 'Małachowskiego', 'Małopolska', 'Marszałkowska', 'Matejki', + 'Mazowiecka', 'Mazurska', 'Miarki', 'Mickiewicza', 'Miedziana', 'Mieszka I', + 'Miła', 'Miodowa', 'Młynarska', 'Młyńska', 'Modlińska', 'Modra', 'Modrzejewskiej', + 'Modrzewiowa', 'Mokra', 'Moniuszki', 'Morcinka', 'Morelowa', 'Morska', + 'Mostowa', 'Myśliwska', 'Nadbrzeżna', 'Nadrzeczna', 'Nałkowskiej', 'Narutowicza', + 'Niecała', 'Niedziałkowskiego', 'Niemcewicza', 'Niepodległości', + 'Al. Niepodległości', 'Niska', 'Norwida', 'Nowa', 'Nowowiejska', 'Nowowiejskiego', 'Nowy Świat', 'Obrońców Westerplatte', 'Odrodzenia', 'Odrzańska', 'Ogrodowa', 'Okopowa', - 'Okólna', 'Okrężna', 'Okrzei Stefana', 'Okulickiego Leopolda', 'Olchowa', 'Olimpijska', - 'Olsztyńska', 'Opolska', 'Orkana Władysława', 'Orla', 'Orzechowa', 'Orzeszkowej Elizy', - 'Osiedlowa', 'Oświęcimska', 'Owocowa', 'Paderewskiego Ignacego', 'Parkowa', 'Partyzantów', - 'Patriotów', 'Pawia', 'Perłowa', 'Piaskowa', 'Piastowska', 'Piastowskie Os.', 'Piekarska', - 'Piękna', 'Piłsudskiego Józefa', 'Piłsudskiego Józefa', 'Piłsudskiego Józefa Al.', - 'Piotrkowska', 'Piwna', 'Plater Emilii', 'Plebiscytowa', 'Płocka', 'Pocztowa', 'Podchorążych', + 'Okólna', 'Okrężna', 'Okrzei', 'Okulickiego', 'Olchowa', 'Olimpijska', + 'Olsztyńska', 'Opolska', 'Orkana', 'Orla', 'Orzechowa', 'Orzeszkowej', + 'Osiedlowa', 'Oświęcimska', 'Owocowa', 'Paderewskiego', 'Parkowa', 'Partyzantów', + 'Patriotów', 'Pawia', 'Perłowa', 'Piaskowa', 'Piastowska', 'Os. Piastowskie', 'Piekarska', + 'Piękna', 'Piłsudskiego', 'Al. Piłsudskiego', + 'Piotrkowska', 'Piwna', 'Emilii Plater', 'Plebiscytowa', 'Płocka', 'Pocztowa', 'Podchorążych', 'Podgórna', 'Podhalańska', 'Podleśna', 'Podmiejska', 'Podwale', 'Pogodna', 'Pokoju', - 'Pola Wincentego', 'Polna', 'Południowa', 'Pomorska', 'Poniatowskiego Józefa', 'Poniatowskiego Józefa', - 'Popiełuszki Jerzego', 'Poprzeczna', 'Portowa', 'Porzeczkowa', 'Powstańców', 'Powstańców Śląskich', + 'Wincentego Pola', 'Polna', 'Południowa', 'Pomorska', 'Poniatowskiego', + 'Popiełuszki', 'Poprzeczna', 'Portowa', 'Porzeczkowa', 'Powstańców', 'Powstańców Śląskich', 'Powstańców Wielkopolskich', 'Poziomkowa', 'Poznańska', 'Północna', 'Promienna', - 'Prosta', 'Prusa Bolesława', 'Przechodnia', 'Przemysłowa', 'Przybyszewskiego Stanisława', - 'Przyjaźni', 'Pszenna', 'Ptasia', 'Pułaskiego Kazimierza', 'Pułaskiego Kazimierza', - 'Puławska', 'Puszkina Aleksandra', 'Racławicka', 'Radomska', 'Radosna', 'Rataja Macieja', - 'Reja Mikołaja', 'Rejtana Tadeusza', 'Reymonta Władysława', 'Reymonta Władysława Stanisława', + 'Prosta', 'Bolesława Prusa', 'Przechodnia', 'Przemysłowa', 'Przybyszewskiego', + 'Przyjaźni', 'Pszenna', 'Ptasia', 'Pułaskiego', 'Puławska', 'Puszkina', 'Racławicka', + 'Radomska', 'Radosna', 'Rataja', 'Reja', 'Rejtana', 'Reymonta', 'Robotnicza', 'Rodzinna', 'Rolna', 'Rolnicza', 'Równa', 'Różana', 'Rubinowa', 'Rumiankowa', - 'Rybacka', 'Rybna', 'Rybnicka', 'Rycerska', 'Rynek', 'Rynek Rynek', 'Rzeczna', 'Rzemieślnicza', - 'Sadowa', 'Sandomierska', 'Saperów', 'Sawickiej Hanki', 'Sądowa', 'Sąsiedzka', 'Senatorska', - 'Siemiradzkiego Henryka', 'Sienkiewicza Henryka', 'Sienna', 'Siewna', 'Sikorskiego Władysława', - 'Sikorskiego Władysława', 'Skargi Piotra', 'Skargi Piotra', 'Składowa', 'Skłodowskiej-Curie Marii', - 'Skośna', 'Skrajna', 'Słoneczna', 'Słonecznikowa', 'Słowackiego Juliusza', 'Słowiańska', - 'Słowicza', 'Sobieskiego Jana', 'Sobieskiego Jana III', 'Sokola', 'Solidarności Al.', - 'Solna', 'Solskiego Ludwika', 'Sosnowa', 'Sowia', 'Sowińskiego Józefa', 'Spacerowa', - 'Spokojna', 'Sportowa', 'Spółdzielcza', 'Srebrna', 'Staffa Leopolda', 'Stalowa', 'Staromiejska', - 'Starowiejska', 'Staszica Stanisława', 'Stawowa', 'Stolarska', 'Strażacka', 'Stroma', - 'Struga Andrzeja', 'Strumykowa', 'Strzelecka', 'Studzienna', 'Stwosza Wita', 'Sucha', - 'Sucharskiego Henryka', 'Szafirowa', 'Szarych Szeregów', 'Szczecińska', 'Szczęśliwa', - 'Szeroka', 'Szewska', 'Szkolna', 'Szmaragdowa', 'Szpitalna', 'Szymanowskiego Karola', - 'Ściegiennego Piotra', 'Śląska', 'Średnia', 'Środkowa', 'Świdnicka', 'Świerkowa', + 'Rybacka', 'Rybna', 'Rybnicka', 'Rycerska', 'Rynek', 'Rzeczna', 'Rzemieślnicza', + 'Sadowa', 'Sandomierska', 'Saperów', 'Sawickiej', 'Sądowa', 'Sąsiedzka', 'Senatorska', + 'Siemiradzkiego', 'Sienkiewicza', 'Sienna', 'Siewna', + 'Sikorskiego', 'Piotra Skargi', 'Składowa', 'Skłodowskiej-Curie', + 'Skośna', 'Skrajna', 'Słoneczna', 'Słonecznikowa', 'Słowackiego', 'Słowiańska', + 'Słowicza', 'Sobieskiego', 'Jana III Sobieskiego', 'Sokola', 'Al. Solidarności', + 'Solna', 'Solskiego', 'Sosnowa', 'Sowia', 'Sowińskiego', 'Spacerowa', + 'Spokojna', 'Sportowa', 'Spółdzielcza', 'Srebrna', 'Staffa ', 'Stalowa', 'Staromiejska', + 'Starowiejska', 'Staszica', 'Stawowa', 'Stolarska', 'Strażacka', 'Stroma', + 'Struga', 'Strumykowa', 'Strzelecka', 'Studzienna', 'Wita Stwosza', 'Sucha', + 'Sucharskiego', 'Szafirowa', 'Szarych Szeregów', 'Szczecińska', 'Szczęśliwa', + 'Szeroka', 'Szewska', 'Szkolna', 'Szmaragdowa', 'Szpitalna', 'Szymanowskiego', + 'Ściegiennego', 'Śląska', 'Średnia', 'Środkowa', 'Świdnicka', 'Świerkowa', 'Świętojańska', 'Świętokrzyska', 'Targowa', 'Tatrzańska', 'Tęczowa', 'Topolowa', - 'Torowa', 'Toruńska', 'Towarowa', 'Traugutta Romualda', 'Truskawkowa', 'Tulipanowa', - 'Tulipanów', 'Turkusowa', 'Turystyczna', 'Tuwima Juliana', 'Tylna', 'Tysiąclecia', 'Ułańska', - 'Urocza', 'Wałowa', 'Wandy', 'Wańkowicza Melchiora', 'Wapienna', 'Warmińska', 'Warszawska', - 'Waryńskiego Ludwika', 'Wąska', 'Wczasowa', 'Wesoła', 'Węglowa', 'Widok', 'Wiejska', - 'Wielkopolska', 'Wieniawskiego Henryka', 'Wierzbowa', 'Wilcza', 'Wileńska', 'Willowa', - 'Wiosenna', 'Wiśniowa', 'Witosa Wincentego', 'Władysława IV', 'Wodna', 'Wojska Polskiego', - 'Wojska Polskiego Al.', 'Wolności', 'Wolności Pl.', 'Wolska', 'Wołodyjowskiego Michała', - 'Wrocławska', 'Wronia', 'Wróblewskiego Walerego', 'Wrzosowa', 'Wschodnia', 'Wspólna', - 'Wybickiego Józefa', 'Wysoka', 'Wyspiańskiego Stanisława', 'Wyszyńskiego Stefana', - 'Wyzwolenia', 'Wyzwolenia Al.', 'Zachodnia', 'Zacisze', 'Zajęcza', 'Zakątek', 'Zakopiańska', - 'Zamenhofa Ludwika', 'Zamkowa', 'Zapolskiej Gabrieli', 'Zbożowa', 'Zdrojowa', 'Zgierska', + 'Torowa', 'Toruńska', 'Towarowa', 'Traugutta', 'Truskawkowa', 'Tulipanowa', + 'Tulipanów', 'Turkusowa', 'Turystyczna', 'Tuwima', 'Tylna', 'Tysiąclecia', 'Ułańska', + 'Urocza', 'Wałowa', 'Wandy', 'Wańkowicza', 'Wapienna', 'Warmińska', 'Warszawska', + 'Waryńskiego', 'Wąska', 'Wczasowa', 'Wesoła', 'Węglowa', 'Widok', 'Wiejska', + 'Wielkopolska', 'Wieniawskiego', 'Wierzbowa', 'Wilcza', 'Wileńska', 'Willowa', + 'Wiosenna', 'Wiśniowa', 'Witosa', 'Władysława IV', 'Wodna', 'Wojska Polskiego', + 'Al. Wojska Polskiego', 'Wolności', 'Pl. Wolności', 'Wolska', 'Wołodyjowskiego', + 'Wrocławska', 'Wronia', 'Wróblewskiego', 'Wrzosowa', 'Wschodnia', 'Wspólna', + 'Wybickiego', 'Wysoka', 'Wyspiańskiego', 'Wyszyńskiego', + 'Wyzwolenia', 'Al. Wyzwolenia', 'Zachodnia', 'Zacisze', 'Zajęcza', 'Zakątek', 'Zakopiańska', + 'Zamenhofa', 'Zamkowa', 'Zapolskiej', 'Zbożowa', 'Zdrojowa', 'Zgierska', 'Zielna', 'Zielona', 'Złota', 'Zwierzyniecka', 'Zwycięstwa', 'Źródlana', 'Żabia', - 'Żeglarska', 'Żelazna', 'Żeromskiego Stefana', 'Żniwna', 'Żołnierska', 'Żółkiewskiego Stanisława', - 'Żurawia', 'Żwirki Franciszka i Wigury Stanisława', 'Żwirki i Wigury', 'Żwirowa', - 'Żytnia', + 'Żeglarska', 'Żelazna', 'Żeromskiego', 'Żniwna', 'Żołnierska', 'Żółkiewskiego', + 'Żurawia', 'Żwirki i Wigury', 'Żwirowa', 'Żytnia', ]; public function city() diff --git a/src/Faker/Provider/pl_PL/Internet.php b/src/Faker/Provider/pl_PL/Internet.php index 661e4b0bc2..f6ed7f6b5b 100644 --- a/src/Faker/Provider/pl_PL/Internet.php +++ b/src/Faker/Provider/pl_PL/Internet.php @@ -5,5 +5,5 @@ class Internet extends \Faker\Provider\Internet { protected static $freeEmailDomain = ['gmail.com', 'yahoo.com', 'wp.pl', 'onet.pl', 'interia.pl', 'gazeta.pl']; - protected static $tld = ['pl', 'pl', 'pl', 'pl', 'pl', 'pl', 'com', 'info', 'net', 'org', 'com.pl', 'com.pl']; + protected static $tld = ['pl', 'pl', 'pl', 'pl', 'pl', 'pl', 'com', 'info', 'net', 'org', 'com.pl', 'com.pl', 'co.pl', 'net.pl', 'org.pl']; } From 5ce0bf295de6bcb80f8f530fa377db8ff63002a8 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Sat, 29 Jul 2023 19:49:17 +0200 Subject: [PATCH 10/70] Fix psalm baseline in .gitattributes (#674) --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 5ee738da79..5634d98c1b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,6 +11,6 @@ /phpstan-baseline.neon export-ignore /phpstan.neon.dist export-ignore /phpunit.xml.dist export-ignore -/psalm-baseline.xml export-ignore +/psalm.baseline.xml export-ignore /psalm.xml export-ignore /roave-bc-check.yaml export-ignore From 66316225da2c610c5f93a4c9789a128d664c1c70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 22:15:41 +0200 Subject: [PATCH 11/70] composer(deps): bump rector/rector in /vendor-bin/rector (#676) Bumps [rector/rector](https://github.com/rectorphp/rector) from 0.17.2 to 0.17.7. - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](https://github.com/rectorphp/rector/compare/0.17.2...0.17.7) --- updated-dependencies: - dependency-name: rector/rector dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor-bin/rector/composer.json | 2 +- vendor-bin/rector/composer.lock | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/vendor-bin/rector/composer.json b/vendor-bin/rector/composer.json index 176d5e8265..4629c7e110 100644 --- a/vendor-bin/rector/composer.json +++ b/vendor-bin/rector/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^8.1", - "rector/rector": "^0.17.2" + "rector/rector": "^0.17.7" }, "config": { "platform": { diff --git a/vendor-bin/rector/composer.lock b/vendor-bin/rector/composer.lock index b0e8881b4e..3d01a9a03e 100644 --- a/vendor-bin/rector/composer.lock +++ b/vendor-bin/rector/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3dd80c93457ab30710aed15359aecad9", + "content-hash": "38de6ca28e0714d43c68fea81ac1be10", "packages": [ { "name": "phpstan/phpstan", - "version": "1.10.22", + "version": "1.10.26", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "97d694dfd4ceb57bcce4e3b38548f13ea62e4287" + "reference": "5d660cbb7e1b89253a47147ae44044f49832351f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/97d694dfd4ceb57bcce4e3b38548f13ea62e4287", - "reference": "97d694dfd4ceb57bcce4e3b38548f13ea62e4287", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5d660cbb7e1b89253a47147ae44044f49832351f", + "reference": "5d660cbb7e1b89253a47147ae44044f49832351f", "shasum": "" }, "require": { @@ -66,25 +66,25 @@ "type": "tidelift" } ], - "time": "2023-06-30T20:04:11+00:00" + "time": "2023-07-19T12:44:37+00:00" }, { "name": "rector/rector", - "version": "0.17.2", + "version": "0.17.7", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "b8f72ff7e4914bb1d1557cc5c6d33898f7fd2bfb" + "reference": "0e76101aa329911b7fec43106aac5843a978b209" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/b8f72ff7e4914bb1d1557cc5c6d33898f7fd2bfb", - "reference": "b8f72ff7e4914bb1d1557cc5c6d33898f7fd2bfb", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/0e76101aa329911b7fec43106aac5843a978b209", + "reference": "0e76101aa329911b7fec43106aac5843a978b209", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.20" + "phpstan/phpstan": "^1.10.26" }, "conflict": { "rector/rector-doctrine": "*", @@ -119,7 +119,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.17.2" + "source": "https://github.com/rectorphp/rector/tree/0.17.7" }, "funding": [ { @@ -127,7 +127,7 @@ "type": "github" } ], - "time": "2023-06-29T10:03:28+00:00" + "time": "2023-07-23T20:44:23+00:00" } ], "packages-dev": [], From 5f3281deaf7b87e0a9ac33d41708fa0bfb02cb34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 22:17:17 +0200 Subject: [PATCH 12/70] composer(deps): bump phpstan/phpstan in /vendor-bin/phpstan (#677) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.22 to 1.10.26. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.10.22...1.10.26) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor-bin/phpstan/composer.json | 2 +- vendor-bin/phpstan/composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index a56f4245a5..7fac44fde0 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -2,7 +2,7 @@ "require": { "php": "^7.4 || ^8.0", "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.10.22", + "phpstan/phpstan": "^1.10.26", "phpstan/phpstan-deprecation-rules": "^1.1.3" }, "config": { diff --git a/vendor-bin/phpstan/composer.lock b/vendor-bin/phpstan/composer.lock index b9cebef88a..6e93fdf443 100644 --- a/vendor-bin/phpstan/composer.lock +++ b/vendor-bin/phpstan/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "863043782a582fdfd295bb0a0cd51c08", + "content-hash": "01f684f3d02eaa69106eb0df92a9ac38", "packages": [ { "name": "phpstan/extension-installer", @@ -52,16 +52,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.22", + "version": "1.10.26", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "97d694dfd4ceb57bcce4e3b38548f13ea62e4287" + "reference": "5d660cbb7e1b89253a47147ae44044f49832351f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/97d694dfd4ceb57bcce4e3b38548f13ea62e4287", - "reference": "97d694dfd4ceb57bcce4e3b38548f13ea62e4287", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5d660cbb7e1b89253a47147ae44044f49832351f", + "reference": "5d660cbb7e1b89253a47147ae44044f49832351f", "shasum": "" }, "require": { @@ -110,7 +110,7 @@ "type": "tidelift" } ], - "time": "2023-06-30T20:04:11+00:00" + "time": "2023-07-19T12:44:37+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", From 72392f010e0e081faca5e3dc77fae1ccd9cda947 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 22:21:06 +0200 Subject: [PATCH 13/70] composer(deps): bump friendsofphp/php-cs-fixer (#679) Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.20.0 to 3.22.0. - [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases) - [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md) - [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.20.0...v3.22.0) --- updated-dependencies: - dependency-name: friendsofphp/php-cs-fixer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor-bin/php-cs-fixer/composer.json | 2 +- vendor-bin/php-cs-fixer/composer.lock | 75 ++++++++++++++------------- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/vendor-bin/php-cs-fixer/composer.json b/vendor-bin/php-cs-fixer/composer.json index b49e67eb2b..b5e879f6a5 100644 --- a/vendor-bin/php-cs-fixer/composer.json +++ b/vendor-bin/php-cs-fixer/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^7.4 || ^8.0", - "friendsofphp/php-cs-fixer": "^3.20.0" + "friendsofphp/php-cs-fixer": "^3.22.0" }, "config": { "platform": { diff --git a/vendor-bin/php-cs-fixer/composer.lock b/vendor-bin/php-cs-fixer/composer.lock index 8abed99b19..dacdc76c57 100644 --- a/vendor-bin/php-cs-fixer/composer.lock +++ b/vendor-bin/php-cs-fixer/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9950cb32653c494c4cd0bf260df0453e", + "content-hash": "bad07ff1321f61559511a3b5cb4c2d71", "packages": [ { "name": "composer/pcre", @@ -427,16 +427,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.20.0", + "version": "v3.22.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "0e8249e0b15e2bc022fbbd1090ce29d071481e69" + "reference": "92b019f6c8d79aa26349d0db7671d37440dc0ff3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/0e8249e0b15e2bc022fbbd1090ce29d071481e69", - "reference": "0e8249e0b15e2bc022fbbd1090ce29d071481e69", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/92b019f6c8d79aa26349d0db7671d37440dc0ff3", + "reference": "92b019f6c8d79aa26349d0db7671d37440dc0ff3", "shasum": "" }, "require": { @@ -460,6 +460,7 @@ "symfony/stopwatch": "^5.4 || ^6.0" }, "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", "justinrainbow/json-schema": "^5.2", "keradus/cli-executor": "^2.0", "mikey179/vfsstream": "^1.6.11", @@ -511,7 +512,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.20.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.22.0" }, "funding": [ { @@ -519,7 +520,7 @@ "type": "github" } ], - "time": "2023-06-27T20:22:39+00:00" + "time": "2023-07-16T23:08:06+00:00" }, { "name": "psr/cache", @@ -786,16 +787,16 @@ }, { "name": "symfony/console", - "version": "v5.4.24", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8" + "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", + "url": "https://api.github.com/repos/symfony/console/zipball/b504a3d266ad2bb632f196c0936ef2af5ff6e273", + "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273", "shasum": "" }, "require": { @@ -865,7 +866,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.24" + "source": "https://github.com/symfony/console/tree/v5.4.26" }, "funding": [ { @@ -881,7 +882,7 @@ "type": "tidelift" } ], - "time": "2023-05-26T05:13:16+00:00" + "time": "2023-07-19T20:11:33+00:00" }, { "name": "symfony/deprecation-contracts", @@ -952,16 +953,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.4.22", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "1df20e45d56da29a4b1d8259dd6e950acbf1b13f" + "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1df20e45d56da29a4b1d8259dd6e950acbf1b13f", - "reference": "1df20e45d56da29a4b1d8259dd6e950acbf1b13f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5dcc00e03413f05c1e7900090927bb7247cb0aac", + "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac", "shasum": "" }, "require": { @@ -1017,7 +1018,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.22" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.26" }, "funding": [ { @@ -1033,7 +1034,7 @@ "type": "tidelift" } ], - "time": "2023-03-17T11:31:58+00:00" + "time": "2023-07-06T06:34:20+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -1180,16 +1181,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.21", + "version": "v5.4.27", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", + "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d", + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d", "shasum": "" }, "require": { @@ -1223,7 +1224,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.21" + "source": "https://github.com/symfony/finder/tree/v5.4.27" }, "funding": [ { @@ -1239,7 +1240,7 @@ "type": "tidelift" } ], - "time": "2023-02-16T09:33:00+00:00" + "time": "2023-07-31T08:02:31+00:00" }, { "name": "symfony/options-resolver", @@ -1883,16 +1884,16 @@ }, { "name": "symfony/process", - "version": "v5.4.24", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "e3c46cc5689c8782944274bb30702106ecbe3b64" + "reference": "1a44dc377ec86a50fab40d066cd061e28a6b482f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/e3c46cc5689c8782944274bb30702106ecbe3b64", - "reference": "e3c46cc5689c8782944274bb30702106ecbe3b64", + "url": "https://api.github.com/repos/symfony/process/zipball/1a44dc377ec86a50fab40d066cd061e28a6b482f", + "reference": "1a44dc377ec86a50fab40d066cd061e28a6b482f", "shasum": "" }, "require": { @@ -1925,7 +1926,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.24" + "source": "https://github.com/symfony/process/tree/v5.4.26" }, "funding": [ { @@ -1941,7 +1942,7 @@ "type": "tidelift" } ], - "time": "2023-05-17T11:26:05+00:00" + "time": "2023-07-12T15:44:31+00:00" }, { "name": "symfony/service-contracts", @@ -2090,16 +2091,16 @@ }, { "name": "symfony/string", - "version": "v5.4.22", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62" + "reference": "1181fe9270e373537475e826873b5867b863883c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", - "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", + "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c", + "reference": "1181fe9270e373537475e826873b5867b863883c", "shasum": "" }, "require": { @@ -2156,7 +2157,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.22" + "source": "https://github.com/symfony/string/tree/v5.4.26" }, "funding": [ { @@ -2172,7 +2173,7 @@ "type": "tidelift" } ], - "time": "2023-03-14T06:11:53+00:00" + "time": "2023-06-28T12:46:07+00:00" } ], "packages-dev": [], From 1d21cbcbf7b2f7f5b1aa4b415a7b80f31f35a57d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 22:22:07 +0200 Subject: [PATCH 14/70] composer(deps): bump vimeo/psalm from 5.13.1 to 5.14.1 in /vendor-bin/psalm (#678) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * composer(deps): bump vimeo/psalm in /vendor-bin/psalm Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 5.13.1 to 5.14.1. - [Release notes](https://github.com/vimeo/psalm/releases) - [Commits](https://github.com/vimeo/psalm/compare/5.13.1...5.14.1) --- updated-dependencies: - dependency-name: vimeo/psalm dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix: Run 'make baseline' --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andreas Möller --- psalm.baseline.xml | 9 +++++- vendor-bin/psalm/composer.json | 2 +- vendor-bin/psalm/composer.lock | 54 +++++++++++++++++----------------- 3 files changed, 36 insertions(+), 29 deletions(-) diff --git a/psalm.baseline.xml b/psalm.baseline.xml index 271a6a6b2e..170c7c2780 100644 --- a/psalm.baseline.xml +++ b/psalm.baseline.xml @@ -1,5 +1,5 @@ - + 0 @@ -142,6 +142,13 @@ [static::class, 'randomDigit'] + static function ($matches) { + // remove backslashes (that are not followed by another backslash) because they are escape characters + $match = preg_replace('/\\\(?!\\\)/', '', $matches[1]); + $randomElement = Base::randomElement(str_split($match)); + //[.] should not be a random character, but a literal . + return str_replace('.', '\.', $randomElement); + } \UnitEnum diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json index 1b3cd62fb3..e1cb8957dd 100644 --- a/vendor-bin/psalm/composer.json +++ b/vendor-bin/psalm/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^7.4 || ^8.0", - "vimeo/psalm": "^5.13.1" + "vimeo/psalm": "^5.14.1" }, "config": { "platform": { diff --git a/vendor-bin/psalm/composer.lock b/vendor-bin/psalm/composer.lock index ea2b3dd065..0102c7db2b 100644 --- a/vendor-bin/psalm/composer.lock +++ b/vendor-bin/psalm/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "37211349afb3a730daadebfce9228beb", + "content-hash": "9256a4cf322e5ef672cbd6d5283a2360", "packages": [ { "name": "amphp/amp", @@ -913,16 +913,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.22.0", + "version": "1.23.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c" + "reference": "a2b24135c35852b348894320d47b3902a94bc494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", - "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a2b24135c35852b348894320d47b3902a94bc494", + "reference": "a2b24135c35852b348894320d47b3902a94bc494", "shasum": "" }, "require": { @@ -954,9 +954,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.0" }, - "time": "2023-06-01T12:35:21+00:00" + "time": "2023-07-23T22:17:56+00:00" }, { "name": "psr/container", @@ -1188,16 +1188,16 @@ }, { "name": "symfony/console", - "version": "v5.4.24", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8" + "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", + "url": "https://api.github.com/repos/symfony/console/zipball/b504a3d266ad2bb632f196c0936ef2af5ff6e273", + "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273", "shasum": "" }, "require": { @@ -1267,7 +1267,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.24" + "source": "https://github.com/symfony/console/tree/v5.4.26" }, "funding": [ { @@ -1283,7 +1283,7 @@ "type": "tidelift" } ], - "time": "2023-05-26T05:13:16+00:00" + "time": "2023-07-19T20:11:33+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1993,16 +1993,16 @@ }, { "name": "symfony/string", - "version": "v5.4.22", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62" + "reference": "1181fe9270e373537475e826873b5867b863883c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", - "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", + "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c", + "reference": "1181fe9270e373537475e826873b5867b863883c", "shasum": "" }, "require": { @@ -2059,7 +2059,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.22" + "source": "https://github.com/symfony/string/tree/v5.4.26" }, "funding": [ { @@ -2075,20 +2075,20 @@ "type": "tidelift" } ], - "time": "2023-03-14T06:11:53+00:00" + "time": "2023-06-28T12:46:07+00:00" }, { "name": "vimeo/psalm", - "version": "5.13.1", + "version": "5.14.1", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "086b94371304750d1c673315321a55d15fc59015" + "reference": "b9d355e0829c397b9b3b47d0c0ed042a8a70284d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/086b94371304750d1c673315321a55d15fc59015", - "reference": "086b94371304750d1c673315321a55d15fc59015", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/b9d355e0829c397b9b3b47d0c0ed042a8a70284d", + "reference": "b9d355e0829c397b9b3b47d0c0ed042a8a70284d", "shasum": "" }, "require": { @@ -2109,8 +2109,8 @@ "felixfbecker/language-server-protocol": "^1.5.2", "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.14", - "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "nikic/php-parser": "^4.16", + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", "sebastian/diff": "^4.0 || ^5.0", "spatie/array-to-xml": "^2.17.0 || ^3.0", "symfony/console": "^4.1.6 || ^5.0 || ^6.0", @@ -2179,9 +2179,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.13.1" + "source": "https://github.com/vimeo/psalm/tree/5.14.1" }, - "time": "2023-06-27T16:39:49+00:00" + "time": "2023-08-01T05:16:55+00:00" }, { "name": "webmozart/assert", From 840d2e9125e0c34f20495271f6f55b96c6be18a3 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 25 Aug 2023 10:37:19 +0200 Subject: [PATCH 15/70] chore: ensure php 8.3 compatibility (#684) Co-authored-by: Christopher Georg --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c6974c386d..6c5f5796cc 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,6 +20,7 @@ jobs: - "8.0" - "8.1" - "8.2" + - "8.3" runs-on: "ubuntu-latest" From af7428b76efdc08dd7824785b58aa118e03f9d55 Mon Sep 17 00:00:00 2001 From: Romain Monteil Date: Sat, 26 Aug 2023 10:02:18 +0200 Subject: [PATCH 16/70] Remove invalid postcode pattern for France (#683) --- src/Faker/Provider/fr_FR/Address.php | 6 +++++- test/Faker/Provider/fr_FR/AddressTest.php | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Faker/Provider/fr_FR/Address.php b/src/Faker/Provider/fr_FR/Address.php index 106f648cca..d6dbb76cca 100644 --- a/src/Faker/Provider/fr_FR/Address.php +++ b/src/Faker/Provider/fr_FR/Address.php @@ -34,7 +34,11 @@ class Address extends \Faker\Provider\Address ]; protected static $buildingNumber = ['%', '%#', '%#', '%#', '%##']; - protected static $postcode = ['#####', '## ###']; + + /** + * @see https://en.wikipedia.org/wiki/Postal_codes_in_France + */ + protected static $postcode = ['#####']; protected static $country = [ 'Afghanistan', 'Afrique du sud', 'Albanie', 'Algérie', 'Allemagne', 'Andorre', 'Angola', 'Anguilla', 'Antarctique', 'Antigua et Barbuda', 'Antilles néerlandaises', 'Arabie saoudite', 'Argentine', 'Arménie', 'Aruba', 'Australie', 'Autriche', 'Azerbaïdjan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Belgique', 'Belize', 'Benin', 'Bermudes (Les)', 'Bhoutan', 'Biélorussie', 'Bolivie', 'Bosnie-Herzégovine', 'Botswana', 'Bouvet (Îles)', 'Brunei', 'Brésil', 'Bulgarie', 'Burkina Faso', 'Burundi', 'Cambodge', 'Cameroun', 'Canada', 'Cap Vert', 'Cayman (Îles)', 'Chili', 'Chine (Rép. pop.)', 'Christmas (Île)', 'Chypre', 'Cocos (Îles)', 'Colombie', 'Comores', 'Cook (Îles)', 'Corée du Nord', 'Corée, Sud', 'Costa Rica', 'Croatie', 'Cuba', 'Côte d\'Ivoire', 'Danemark', 'Djibouti', 'Dominique', 'Égypte', 'El Salvador', 'Émirats arabes unis', 'Équateur', 'Érythrée', 'Espagne', 'Estonie', 'États-Unis', 'Ethiopie', 'Falkland (Île)', 'Fidji (République des)', 'Finlande', 'France', 'Féroé (Îles)', 'Gabon', diff --git a/test/Faker/Provider/fr_FR/AddressTest.php b/test/Faker/Provider/fr_FR/AddressTest.php index 1f48f54d5f..c2bd8697b4 100644 --- a/test/Faker/Provider/fr_FR/AddressTest.php +++ b/test/Faker/Provider/fr_FR/AddressTest.php @@ -10,6 +10,14 @@ */ final class AddressTest extends TestCase { + public function testPostcode(): void + { + $postcode = $this->faker->postcode(); + self::assertNotEmpty($postcode); + self::assertIsString($postcode); + self::assertMatchesRegularExpression('@^\d{5}$@', $postcode); + } + public function testSecondaryAddress(): void { self::assertEquals('Étage 007', $this->faker->secondaryAddress()); From 8a79daf7d1cccc28388b27eccb7fac63480608af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sat, 2 Sep 2023 16:33:32 +0200 Subject: [PATCH 17/70] Fix: Allow tests to fail on PHP 8.3 (#693) --- .github/workflows/tests.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6c5f5796cc..bc6fa82dab 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -11,16 +11,20 @@ name: "Tests" jobs: phpunit: - name: "PHPUnit" + name: "PHPUnit (${{ matrix.php-version }})" strategy: matrix: + experimental: + - false php-version: - "7.4" - "8.0" - "8.1" - "8.2" - - "8.3" + include: + - experimental: true + php-version: "8.3" runs-on: "ubuntu-latest" @@ -53,3 +57,4 @@ jobs: - name: "Run tests" run: "./vendor/bin/phpunit --colors=always" + continue-on-error: "${{ matrix.experimental }}" From 14888813a8d4a5eb32430df9d74c80fa78f05bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sat, 2 Sep 2023 17:15:45 +0200 Subject: [PATCH 18/70] Fix: Test does not perform any assertions (#695) --- test/Faker/UniqueGeneratorTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/Faker/UniqueGeneratorTest.php b/test/Faker/UniqueGeneratorTest.php index bf7b147c8d..f1ad670dd8 100644 --- a/test/Faker/UniqueGeneratorTest.php +++ b/test/Faker/UniqueGeneratorTest.php @@ -23,5 +23,7 @@ public function testUniqueGeneratorRetries(): void for ($i = 0; $i < 10; ++$i) { $this->faker->unique()->ext(NumberExtension::class)->numberBetween(0, 9); } + + $this->addToAssertionCount(1); } } From b048b4aa9859651492b0949e5fffe48907d10a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sat, 2 Sep 2023 17:16:22 +0200 Subject: [PATCH 19/70] Fix: Operator (#696) --- test/Faker/Provider/ImageTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Faker/Provider/ImageTest.php b/test/Faker/Provider/ImageTest.php index ff5e7f1c8a..1aa495e17c 100644 --- a/test/Faker/Provider/ImageTest.php +++ b/test/Faker/Provider/ImageTest.php @@ -185,7 +185,7 @@ private static function checkUrlConnection(string $url): void $httpCode = curl_getinfo($curlPing, CURLINFO_HTTP_CODE); curl_close($curlPing); - if ($httpCode < 200 | $httpCode > 300) { + if ($httpCode < 200 || $httpCode > 300) { self::markTestSkipped(sprintf('"%s" is offline, skipping test', $url)); } } From 7a06315855efe0e6e7cb185eaac6770c22692924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sat, 2 Sep 2023 17:17:09 +0200 Subject: [PATCH 20/70] Fix: Use boolean expressions (#697) --- src/Faker/Core/Version.php | 8 ++++---- src/Faker/Extension/Helper.php | 2 +- src/Faker/Provider/Base.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Faker/Core/Version.php b/src/Faker/Core/Version.php index ce484e6ad8..f5e7cf5a08 100644 --- a/src/Faker/Core/Version.php +++ b/src/Faker/Core/Version.php @@ -25,8 +25,8 @@ public function semver(bool $preRelease = false, bool $build = false): string mt_rand(0, 9), mt_rand(0, 99), mt_rand(0, 99), - $preRelease && mt_rand(0, 1) ? '-' . $this->semverPreReleaseIdentifier() : '', - $build && mt_rand(0, 1) ? '+' . $this->semverBuildIdentifier() : '', + $preRelease && mt_rand(0, 1) === 1 ? '-' . $this->semverPreReleaseIdentifier() : '', + $build && mt_rand(0, 1) === 1 ? '+' . $this->semverBuildIdentifier() : '', ); } @@ -37,7 +37,7 @@ private function semverPreReleaseIdentifier(): string { $ident = Helper::randomElement($this->semverCommonPreReleaseIdentifiers); - if (!mt_rand(0, 1)) { + if (mt_rand(0, 1) !== 1) { return $ident; } @@ -49,7 +49,7 @@ private function semverPreReleaseIdentifier(): string */ private function semverBuildIdentifier(): string { - if (mt_rand(0, 1)) { + if (mt_rand(0, 1) === 1) { // short git revision syntax: https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection return substr(sha1(Helper::lexify('??????')), 0, 7); } diff --git a/src/Faker/Extension/Helper.php b/src/Faker/Extension/Helper.php index 27a66143fe..d6245313f9 100644 --- a/src/Faker/Extension/Helper.php +++ b/src/Faker/Extension/Helper.php @@ -83,7 +83,7 @@ public static function lexify(string $string): string public static function bothify(string $string): string { $string = self::replaceWildcard($string, '*', static function () { - return mt_rand(0, 1) ? '#' : '?'; + return mt_rand(0, 1) === 1 ? '#' : '?'; }); return static::lexify(static::numerify($string)); diff --git a/src/Faker/Provider/Base.php b/src/Faker/Provider/Base.php index d91552c8a3..a590afb478 100644 --- a/src/Faker/Provider/Base.php +++ b/src/Faker/Provider/Base.php @@ -491,7 +491,7 @@ public static function lexify($string = '????') public static function bothify($string = '## ??') { $string = self::replaceWildcard($string, '*', static function () { - return mt_rand(0, 1) ? '#' : '?'; + return mt_rand(0, 1) === 1 ? '#' : '?'; }); return static::lexify(static::numerify($string)); From bfcece8fa2600dbe25cfaa026d95ed6fc827c434 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 17:18:35 +0200 Subject: [PATCH 21/70] composer(deps): bump rector/rector in /vendor-bin/rector (#688) Bumps [rector/rector](https://github.com/rectorphp/rector) from 0.17.7 to 0.18.1. - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](https://github.com/rectorphp/rector/compare/0.17.7...0.18.1) --- updated-dependencies: - dependency-name: rector/rector dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor-bin/rector/composer.json | 2 +- vendor-bin/rector/composer.lock | 31 +++++++++++++------------------ 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/vendor-bin/rector/composer.json b/vendor-bin/rector/composer.json index 4629c7e110..18424d46ab 100644 --- a/vendor-bin/rector/composer.json +++ b/vendor-bin/rector/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^8.1", - "rector/rector": "^0.17.7" + "rector/rector": "^0.18.1" }, "config": { "platform": { diff --git a/vendor-bin/rector/composer.lock b/vendor-bin/rector/composer.lock index 3d01a9a03e..acc90bec5c 100644 --- a/vendor-bin/rector/composer.lock +++ b/vendor-bin/rector/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "38de6ca28e0714d43c68fea81ac1be10", + "content-hash": "dd4072cf57d54447f34914509c1999ed", "packages": [ { "name": "phpstan/phpstan", - "version": "1.10.26", + "version": "1.10.32", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "5d660cbb7e1b89253a47147ae44044f49832351f" + "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5d660cbb7e1b89253a47147ae44044f49832351f", - "reference": "5d660cbb7e1b89253a47147ae44044f49832351f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c47e47d3ab03137c0e121e77c4d2cb58672f6d44", + "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44", "shasum": "" }, "require": { @@ -66,25 +66,25 @@ "type": "tidelift" } ], - "time": "2023-07-19T12:44:37+00:00" + "time": "2023-08-24T21:54:50+00:00" }, { "name": "rector/rector", - "version": "0.17.7", + "version": "0.18.1", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "0e76101aa329911b7fec43106aac5843a978b209" + "reference": "ee72ef542680a7f47ed8c6784f78b032c0d2f381" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/0e76101aa329911b7fec43106aac5843a978b209", - "reference": "0e76101aa329911b7fec43106aac5843a978b209", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/ee72ef542680a7f47ed8c6784f78b032c0d2f381", + "reference": "ee72ef542680a7f47ed8c6784f78b032c0d2f381", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.26" + "phpstan/phpstan": "^1.10.31" }, "conflict": { "rector/rector-doctrine": "*", @@ -96,11 +96,6 @@ "bin/rector" ], "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.15-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -119,7 +114,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.17.7" + "source": "https://github.com/rectorphp/rector/tree/0.18.1" }, "funding": [ { @@ -127,7 +122,7 @@ "type": "github" } ], - "time": "2023-07-23T20:44:23+00:00" + "time": "2023-08-28T18:01:58+00:00" } ], "packages-dev": [], From 47759b18289e53ee0508dd2482371203bfd19178 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 17:18:55 +0200 Subject: [PATCH 22/70] composer(deps): bump phpstan/phpstan in /vendor-bin/phpstan (#689) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.26 to 1.10.32. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.10.26...1.10.32) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor-bin/phpstan/composer.json | 2 +- vendor-bin/phpstan/composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index 7fac44fde0..971bb21ded 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -2,7 +2,7 @@ "require": { "php": "^7.4 || ^8.0", "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.10.26", + "phpstan/phpstan": "^1.10.32", "phpstan/phpstan-deprecation-rules": "^1.1.3" }, "config": { diff --git a/vendor-bin/phpstan/composer.lock b/vendor-bin/phpstan/composer.lock index 6e93fdf443..939a8c352a 100644 --- a/vendor-bin/phpstan/composer.lock +++ b/vendor-bin/phpstan/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "01f684f3d02eaa69106eb0df92a9ac38", + "content-hash": "ab3a8dc7b1925c32630e8ce343da1429", "packages": [ { "name": "phpstan/extension-installer", @@ -52,16 +52,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.26", + "version": "1.10.32", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "5d660cbb7e1b89253a47147ae44044f49832351f" + "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5d660cbb7e1b89253a47147ae44044f49832351f", - "reference": "5d660cbb7e1b89253a47147ae44044f49832351f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c47e47d3ab03137c0e121e77c4d2cb58672f6d44", + "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44", "shasum": "" }, "require": { @@ -110,7 +110,7 @@ "type": "tidelift" } ], - "time": "2023-07-19T12:44:37+00:00" + "time": "2023-08-24T21:54:50+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", From 070868e4c63a4793dda55b0ea762b046ceb970b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 17:20:14 +0200 Subject: [PATCH 23/70] composer(deps): bump vimeo/psalm from 5.14.1 to 5.15.0 in /vendor-bin/psalm (#687) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * composer(deps): bump vimeo/psalm in /vendor-bin/psalm Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 5.14.1 to 5.15.0. - [Release notes](https://github.com/vimeo/psalm/releases) - [Commits](https://github.com/vimeo/psalm/compare/5.14.1...5.15.0) --- updated-dependencies: - dependency-name: vimeo/psalm dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix: Run 'make baseline' --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andreas Möller --- psalm.baseline.xml | 2 +- vendor-bin/psalm/composer.json | 2 +- vendor-bin/psalm/composer.lock | 163 +++++++++++++++++---------------- 3 files changed, 85 insertions(+), 82 deletions(-) diff --git a/psalm.baseline.xml b/psalm.baseline.xml index 170c7c2780..b209427b2c 100644 --- a/psalm.baseline.xml +++ b/psalm.baseline.xml @@ -1,5 +1,5 @@ - + 0 diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json index e1cb8957dd..5ef8200c93 100644 --- a/vendor-bin/psalm/composer.json +++ b/vendor-bin/psalm/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^7.4 || ^8.0", - "vimeo/psalm": "^5.14.1" + "vimeo/psalm": "^5.15.0" }, "config": { "platform": { diff --git a/vendor-bin/psalm/composer.lock b/vendor-bin/psalm/composer.lock index 0102c7db2b..b99f2ec160 100644 --- a/vendor-bin/psalm/composer.lock +++ b/vendor-bin/psalm/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9256a4cf322e5ef672cbd6d5283a2360", + "content-hash": "c92d54202d70caf9276f2ad5d3097955", "packages": [ { "name": "amphp/amp", @@ -245,16 +245,16 @@ }, { "name": "composer/semver", - "version": "3.3.2", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "shasum": "" }, "require": { @@ -304,9 +304,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" + "source": "https://github.com/composer/semver/tree/3.4.0" }, "funding": [ { @@ -322,7 +322,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2023-08-31T09:50:34+00:00" }, { "name": "composer/xdebug-handler", @@ -689,16 +689,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.16.0", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -739,9 +739,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" }, - "time": "2023-06-25T14:52:30+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -855,16 +855,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d" + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b2fe4d22a5426f38e014855322200b97b5362c0d", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", "shasum": "" }, "require": { @@ -907,22 +907,22 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3" }, - "time": "2023-05-30T18:13:47+00:00" + "time": "2023-08-12T11:01:26+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.23.0", + "version": "1.23.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "a2b24135c35852b348894320d47b3902a94bc494" + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a2b24135c35852b348894320d47b3902a94bc494", - "reference": "a2b24135c35852b348894320d47b3902a94bc494", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/846ae76eef31c6d7790fac9bc399ecee45160b26", + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26", "shasum": "" }, "require": { @@ -954,9 +954,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.1" }, - "time": "2023-07-23T22:17:56+00:00" + "time": "2023-08-03T16:32:59+00:00" }, { "name": "psr/container", @@ -1188,16 +1188,16 @@ }, { "name": "symfony/console", - "version": "v5.4.26", + "version": "v5.4.28", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273" + "reference": "f4f71842f24c2023b91237c72a365306f3c58827" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/b504a3d266ad2bb632f196c0936ef2af5ff6e273", - "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273", + "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", + "reference": "f4f71842f24c2023b91237c72a365306f3c58827", "shasum": "" }, "require": { @@ -1267,7 +1267,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.26" + "source": "https://github.com/symfony/console/tree/v5.4.28" }, "funding": [ { @@ -1283,7 +1283,7 @@ "type": "tidelift" } ], - "time": "2023-07-19T20:11:33+00:00" + "time": "2023-08-07T06:12:30+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1418,16 +1418,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -1442,7 +1442,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1480,7 +1480,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -1496,20 +1496,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -1521,7 +1521,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1561,7 +1561,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -1577,20 +1577,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -1602,7 +1602,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1645,7 +1645,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -1661,20 +1661,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -1689,7 +1689,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1728,7 +1728,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -1744,20 +1744,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -1766,7 +1766,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1807,7 +1807,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" }, "funding": [ { @@ -1823,20 +1823,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -1845,7 +1845,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1890,7 +1890,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -1906,7 +1906,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/service-contracts", @@ -2079,16 +2079,16 @@ }, { "name": "vimeo/psalm", - "version": "5.14.1", + "version": "5.15.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "b9d355e0829c397b9b3b47d0c0ed042a8a70284d" + "reference": "5c774aca4746caf3d239d9c8cadb9f882ca29352" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/b9d355e0829c397b9b3b47d0c0ed042a8a70284d", - "reference": "b9d355e0829c397b9b3b47d0c0ed042a8a70284d", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/5c774aca4746caf3d239d9c8cadb9f882ca29352", + "reference": "5c774aca4746caf3d239d9c8cadb9f882ca29352", "shasum": "" }, "require": { @@ -2116,6 +2116,9 @@ "symfony/console": "^4.1.6 || ^5.0 || ^6.0", "symfony/filesystem": "^5.4 || ^6.0" }, + "conflict": { + "nikic/php-parser": "4.17.0" + }, "provide": { "psalm/psalm": "self.version" }, @@ -2179,9 +2182,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.14.1" + "source": "https://github.com/vimeo/psalm/tree/5.15.0" }, - "time": "2023-08-01T05:16:55+00:00" + "time": "2023-08-20T23:07:30+00:00" }, { "name": "webmozart/assert", From 849ff231bb57b0ebda5746bf82fc277aa14fa3e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 17:20:48 +0200 Subject: [PATCH 24/70] composer(deps): bump phpstan/phpstan-deprecation-rules (#690) Bumps [phpstan/phpstan-deprecation-rules](https://github.com/phpstan/phpstan-deprecation-rules) from 1.1.3 to 1.1.4. - [Release notes](https://github.com/phpstan/phpstan-deprecation-rules/releases) - [Commits](https://github.com/phpstan/phpstan-deprecation-rules/compare/1.1.3...1.1.4) --- updated-dependencies: - dependency-name: phpstan/phpstan-deprecation-rules dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor-bin/phpstan/composer.json | 2 +- vendor-bin/phpstan/composer.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index 971bb21ded..e15922f664 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -3,7 +3,7 @@ "php": "^7.4 || ^8.0", "phpstan/extension-installer": "^1.3.1", "phpstan/phpstan": "^1.10.32", - "phpstan/phpstan-deprecation-rules": "^1.1.3" + "phpstan/phpstan-deprecation-rules": "^1.1.4" }, "config": { "platform": { diff --git a/vendor-bin/phpstan/composer.lock b/vendor-bin/phpstan/composer.lock index 939a8c352a..b7d79a163a 100644 --- a/vendor-bin/phpstan/composer.lock +++ b/vendor-bin/phpstan/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ab3a8dc7b1925c32630e8ce343da1429", + "content-hash": "a9a13b1fedad6fc7cf7e70503054cbe2", "packages": [ { "name": "phpstan/extension-installer", @@ -114,21 +114,21 @@ }, { "name": "phpstan/phpstan-deprecation-rules", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "a22b36b955a2e9a3d39fe533b6c1bb5359f9c319" + "reference": "089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/a22b36b955a2e9a3d39fe533b6c1bb5359f9c319", - "reference": "a22b36b955a2e9a3d39fe533b6c1bb5359f9c319", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa", + "reference": "089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10" + "phpstan/phpstan": "^1.10.3" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", @@ -156,9 +156,9 @@ "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "support": { "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.1.3" + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.1.4" }, - "time": "2023-03-17T07:50:08+00:00" + "time": "2023-08-05T09:02:04+00:00" } ], "packages-dev": [], From ea48cdde9e7bc2305e6894d5cabf2a9a34be633d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 17:27:51 +0200 Subject: [PATCH 25/70] composer(deps): bump friendsofphp/php-cs-fixer from 3.22.0 to 3.25.0 in /vendor-bin/php-cs-fixer (#686) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * composer(deps): bump friendsofphp/php-cs-fixer Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.22.0 to 3.25.0. - [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases) - [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md) - [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.22.0...v3.25.0) --- updated-dependencies: - dependency-name: friendsofphp/php-cs-fixer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix: Run 'make cs' * Fix: Run 'make baseline' --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andreas Möller --- psalm.baseline.xml | 1 + src/Faker/Factory.php | 2 + src/Faker/Provider/Base.php | 1 + src/Faker/Provider/Image.php | 1 + src/Faker/Provider/cs_CZ/Person.php | 1 + src/Faker/Provider/en_ZA/Person.php | 5 +- src/Faker/Provider/fi_FI/Person.php | 3 +- src/Faker/Provider/ja_JP/Text.php | 2 + src/Faker/Provider/kk_KZ/Company.php | 2 - src/Faker/Provider/kk_KZ/Person.php | 3 +- src/Faker/Provider/lt_LT/Person.php | 5 +- src/Faker/Provider/lv_LV/Person.php | 2 - src/Faker/Provider/ms_MY/Person.php | 1 + src/Faker/Provider/nb_NO/Person.php | 3 +- src/Faker/Provider/ro_RO/Person.php | 1 + src/Faker/Provider/sv_SE/Person.php | 3 +- vendor-bin/php-cs-fixer/composer.json | 2 +- vendor-bin/php-cs-fixer/composer.lock | 402 +++++--------------------- 18 files changed, 94 insertions(+), 346 deletions(-) diff --git a/psalm.baseline.xml b/psalm.baseline.xml index b209427b2c..ee068ecd7d 100644 --- a/psalm.baseline.xml +++ b/psalm.baseline.xml @@ -146,6 +146,7 @@ // remove backslashes (that are not followed by another backslash) because they are escape characters $match = preg_replace('/\\\(?!\\\)/', '', $matches[1]); $randomElement = Base::randomElement(str_split($match)); + //[.] should not be a random character, but a literal . return str_replace('.', '\.', $randomElement); } diff --git a/src/Faker/Factory.php b/src/Faker/Factory.php index 7d29de75b2..e9d201432d 100644 --- a/src/Faker/Factory.php +++ b/src/Faker/Factory.php @@ -38,10 +38,12 @@ protected static function getProviderClassname($provider, $locale = '') if ($providerClass = self::findProviderClassname($provider, $locale)) { return $providerClass; } + // fallback to default locale if ($providerClass = self::findProviderClassname($provider, static::DEFAULT_LOCALE)) { return $providerClass; } + // fallback to no locale if ($providerClass = self::findProviderClassname($provider)) { return $providerClass; diff --git a/src/Faker/Provider/Base.php b/src/Faker/Provider/Base.php index a590afb478..6b9876bc1d 100644 --- a/src/Faker/Provider/Base.php +++ b/src/Faker/Provider/Base.php @@ -576,6 +576,7 @@ public static function regexify($regex = '') // remove backslashes (that are not followed by another backslash) because they are escape characters $match = preg_replace('/\\\(?!\\\)/', '', $matches[1]); $randomElement = Base::randomElement(str_split($match)); + //[.] should not be a random character, but a literal . return str_replace('.', '\.', $randomElement); }, $regex); diff --git a/src/Faker/Provider/Image.php b/src/Faker/Provider/Image.php index 53f28dfcfa..e787142178 100644 --- a/src/Faker/Provider/Image.php +++ b/src/Faker/Provider/Image.php @@ -123,6 +123,7 @@ public static function image( ); $dir = null === $dir ? sys_get_temp_dir() : $dir; // GNU/Linux / OS X / Windows compatible + // Validate directory path if (!is_dir($dir) || !is_writable($dir)) { throw new \InvalidArgumentException(sprintf('Cannot write to directory "%s"', $dir)); diff --git a/src/Faker/Provider/cs_CZ/Person.php b/src/Faker/Provider/cs_CZ/Person.php index 64b4e9e0c8..e962fb6d9e 100644 --- a/src/Faker/Provider/cs_CZ/Person.php +++ b/src/Faker/Provider/cs_CZ/Person.php @@ -451,6 +451,7 @@ public function birthNumber($gender = null, $minAge = 0, $maxAge = 100, $slashPr if ($gender == static::GENDER_FEMALE) { $month += 50; } + // from year 2004 everyone has +20 to month when birth numbers in one day are exhausted if ($year >= 2004 && $this->generator->boolean(10)) { $month += 20; diff --git a/src/Faker/Provider/en_ZA/Person.php b/src/Faker/Provider/en_ZA/Person.php index df018d1514..2d2b525ede 100644 --- a/src/Faker/Provider/en_ZA/Person.php +++ b/src/Faker/Provider/en_ZA/Person.php @@ -135,9 +135,8 @@ class Person extends \Faker\Provider\Person /** * @see https://en.wikipedia.org/wiki/National_identification_number#South_Africa * - * @param \DateTime $birthdate - * @param bool $citizen - * @param string $gender + * @param bool $citizen + * @param string $gender * * @return string */ diff --git a/src/Faker/Provider/fi_FI/Person.php b/src/Faker/Provider/fi_FI/Person.php index 328a44b2c8..bb1c24c06a 100644 --- a/src/Faker/Provider/fi_FI/Person.php +++ b/src/Faker/Provider/fi_FI/Person.php @@ -91,8 +91,7 @@ class Person extends \Faker\Provider\Person * * @see http://www.finlex.fi/fi/laki/ajantasa/2010/20100128 * - * @param \DateTime $birthdate - * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE + * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE * * @return string on format DDMMYYCZZZQ, where DDMMYY is the date of birth, C the century sign, ZZZ the individual number and Q the control character (checksum) */ diff --git a/src/Faker/Provider/ja_JP/Text.php b/src/Faker/Provider/ja_JP/Text.php index 55bcc62972..9cb9a71ba4 100644 --- a/src/Faker/Provider/ja_JP/Text.php +++ b/src/Faker/Provider/ja_JP/Text.php @@ -628,10 +628,12 @@ protected static function appendEnd($text) $chars = static::split($text); $last = end($chars); } + // if the last char is a not-valid-end punctuation, remove it if (in_array($last, static::$notEndPunct, false)) { $text = preg_replace('/.$/u', '', $text); } + // if the last char is not a valid punctuation, append a default one. return in_array($last, static::$endPunct, false) ? $text : $text . '。'; } diff --git a/src/Faker/Provider/kk_KZ/Company.php b/src/Faker/Provider/kk_KZ/Company.php index 4663a748dd..75efebf836 100644 --- a/src/Faker/Provider/kk_KZ/Company.php +++ b/src/Faker/Provider/kk_KZ/Company.php @@ -54,8 +54,6 @@ public static function companyNameSuffix() * * @see http://egov.kz/wps/portal/Content?contentPath=%2Fegovcontent%2Fbus_business%2Ffor_businessmen%2Farticle%2Fbusiness_identification_number&lang=en * - * @param \DateTime $registrationDate - * * @return string 12 digits, like 150140000019 */ public static function businessIdentificationNumber(\DateTime $registrationDate = null) diff --git a/src/Faker/Provider/kk_KZ/Person.php b/src/Faker/Provider/kk_KZ/Person.php index 61852a2143..353dfae4b1 100644 --- a/src/Faker/Provider/kk_KZ/Person.php +++ b/src/Faker/Provider/kk_KZ/Person.php @@ -207,8 +207,7 @@ private static function getCenturyByYear($year) * @see http://egov.kz/wps/portal/Content?contentPath=%2Fegovcontent%2Fcitizen_migration%2Fpassport_id_card%2Farticle%2Fiin_info&lang=en * @see https://ru.wikipedia.org/wiki/%D0%98%D0%BD%D0%B4%D0%B8%D0%B2%D0%B8%D0%B4%D1%83%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9_%D0%B8%D0%B4%D0%B5%D0%BD%D1%82%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%86%D0%B8%D0%BE%D0%BD%D0%BD%D1%8B%D0%B9_%D0%BD%D0%BE%D0%BC%D0%B5%D1%80 * - * @param \DateTime $birthDate - * @param int $gender + * @param int $gender * * @return string 12 digits, like 780322300455 */ diff --git a/src/Faker/Provider/lt_LT/Person.php b/src/Faker/Provider/lt_LT/Person.php index c448ab814f..570eecfbeb 100644 --- a/src/Faker/Provider/lt_LT/Person.php +++ b/src/Faker/Provider/lt_LT/Person.php @@ -325,9 +325,8 @@ public function passportNumber() * @see https://en.wikipedia.org/wiki/National_identification_number#Lithuania * @see https://lt.wikipedia.org/wiki/Asmens_kodas * - * @param string $gender [male|female] - * @param \DateTime $birthdate - * @param string $randomNumber three integers + * @param string $gender [male|female] + * @param string $randomNumber three integers * * @return string on format XXXXXXXXXXX */ diff --git a/src/Faker/Provider/lv_LV/Person.php b/src/Faker/Provider/lv_LV/Person.php index 4e9b93b75d..2139671788 100644 --- a/src/Faker/Provider/lv_LV/Person.php +++ b/src/Faker/Provider/lv_LV/Person.php @@ -134,8 +134,6 @@ public function passportNumber() * * @see https://en.wikipedia.org/wiki/National_identification_number#Latvia * - * @param \DateTime $birthdate - * * @return string on format XXXXXX-XXXXX */ public function personalIdentityNumber(\DateTime $birthdate = null) diff --git a/src/Faker/Provider/ms_MY/Person.php b/src/Faker/Provider/ms_MY/Person.php index 1cd011bf9f..d685715d8f 100644 --- a/src/Faker/Provider/ms_MY/Person.php +++ b/src/Faker/Provider/ms_MY/Person.php @@ -792,6 +792,7 @@ public static function myKadNumber($gender = null, $hyphen = false) // gender digit. Odd = MALE, Even = FEMALE $g = self::numberBetween(0, 9); + //Credit: https://gist.github.com/mauris/3629548 if ($gender === static::GENDER_MALE) { $g = $g | 1; diff --git a/src/Faker/Provider/nb_NO/Person.php b/src/Faker/Provider/nb_NO/Person.php index 86ce721ba3..8ee85cac72 100644 --- a/src/Faker/Provider/nb_NO/Person.php +++ b/src/Faker/Provider/nb_NO/Person.php @@ -288,8 +288,7 @@ class Person extends \Faker\Provider\Person * * @see https://no.wikipedia.org/wiki/Personnummer * - * @param \DateTime $birthdate - * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE + * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE * * @return string on format DDMMYY##### */ diff --git a/src/Faker/Provider/ro_RO/Person.php b/src/Faker/Provider/ro_RO/Person.php index d8ef51d005..9077004135 100644 --- a/src/Faker/Provider/ro_RO/Person.php +++ b/src/Faker/Provider/ro_RO/Person.php @@ -182,6 +182,7 @@ protected function getDateOfBirth($dateOfBirth) $dateOfBirthFinal = implode('-', $dateOfBirthParts); $date = \DateTime::createFromFormat('Y-m-d', $dateOfBirthFinal); + //a full (invalid) date might have been supplied, check if it converts if ($date->format('Y-m-d') !== $dateOfBirthFinal) { throw new \InvalidArgumentException("Invalid date of birth - '{$date->format('Y-m-d')}' generated based on '{$dateOfBirth}' received"); diff --git a/src/Faker/Provider/sv_SE/Person.php b/src/Faker/Provider/sv_SE/Person.php index a98f0871bf..1142a1f63f 100644 --- a/src/Faker/Provider/sv_SE/Person.php +++ b/src/Faker/Provider/sv_SE/Person.php @@ -121,8 +121,7 @@ class Person extends \Faker\Provider\Person * * @see http://en.wikipedia.org/wiki/Personal_identity_number_(Sweden) * - * @param \DateTime $birthdate - * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE + * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE * * @return string on format XXXXXX-XXXX */ diff --git a/vendor-bin/php-cs-fixer/composer.json b/vendor-bin/php-cs-fixer/composer.json index b5e879f6a5..b1249c7172 100644 --- a/vendor-bin/php-cs-fixer/composer.json +++ b/vendor-bin/php-cs-fixer/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^7.4 || ^8.0", - "friendsofphp/php-cs-fixer": "^3.22.0" + "friendsofphp/php-cs-fixer": "^3.25.0" }, "config": { "platform": { diff --git a/vendor-bin/php-cs-fixer/composer.lock b/vendor-bin/php-cs-fixer/composer.lock index dacdc76c57..5412f4cdde 100644 --- a/vendor-bin/php-cs-fixer/composer.lock +++ b/vendor-bin/php-cs-fixer/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bad07ff1321f61559511a3b5cb4c2d71", + "content-hash": "7a2e6176d3f4126c9b59b213a71ccf35", "packages": [ { "name": "composer/pcre", @@ -79,16 +79,16 @@ }, { "name": "composer/semver", - "version": "3.3.2", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "shasum": "" }, "require": { @@ -138,9 +138,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" + "source": "https://github.com/composer/semver/tree/3.4.0" }, "funding": [ { @@ -156,7 +156,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2023-08-31T09:50:34+00:00" }, { "name": "composer/xdebug-handler", @@ -224,226 +224,23 @@ ], "time": "2022-02-25T21:32:43+00:00" }, - { - "name": "doctrine/annotations", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^2 || ^3", - "ext-tokenizer": "*", - "php": "^7.2 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^2.0", - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/2.0.1" - }, - "time": "2023-02-02T22:02:53+00:00" - }, - { - "name": "doctrine/deprecations", - "version": "v1.1.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", - "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" - }, - "time": "2023-06-03T09:27:29+00:00" - }, - { - "name": "doctrine/lexer", - "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", - "shasum": "" - }, - "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^4.11 || ^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/2.1.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "time": "2022-12-14T08:49:07+00:00" - }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.22.0", + "version": "v3.25.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "92b019f6c8d79aa26349d0db7671d37440dc0ff3" + "reference": "9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/92b019f6c8d79aa26349d0db7671d37440dc0ff3", - "reference": "92b019f6c8d79aa26349d0db7671d37440dc0ff3", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d", + "reference": "9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d", "shasum": "" }, "require": { "composer/semver": "^3.3", "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^2", - "doctrine/lexer": "^2 || ^3", "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", @@ -512,7 +309,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.22.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.25.0" }, "funding": [ { @@ -520,56 +317,7 @@ "type": "github" } ], - "time": "2023-07-16T23:08:06+00:00" - }, - { - "name": "psr/cache", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/master" - }, - "time": "2016-08-06T20:24:11+00:00" + "time": "2023-08-31T21:27:18+00:00" }, { "name": "psr/container", @@ -787,16 +535,16 @@ }, { "name": "symfony/console", - "version": "v5.4.26", + "version": "v5.4.28", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273" + "reference": "f4f71842f24c2023b91237c72a365306f3c58827" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/b504a3d266ad2bb632f196c0936ef2af5ff6e273", - "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273", + "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", + "reference": "f4f71842f24c2023b91237c72a365306f3c58827", "shasum": "" }, "require": { @@ -866,7 +614,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.26" + "source": "https://github.com/symfony/console/tree/v5.4.28" }, "funding": [ { @@ -882,7 +630,7 @@ "type": "tidelift" } ], - "time": "2023-07-19T20:11:33+00:00" + "time": "2023-08-07T06:12:30+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1313,16 +1061,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -1337,7 +1085,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1375,7 +1123,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -1391,20 +1139,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -1416,7 +1164,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1456,7 +1204,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -1472,20 +1220,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -1497,7 +1245,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1540,7 +1288,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -1556,20 +1304,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -1584,7 +1332,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1623,7 +1371,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -1639,20 +1387,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -1661,7 +1409,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1702,7 +1450,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" }, "funding": [ { @@ -1718,20 +1466,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -1740,7 +1488,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1785,7 +1533,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -1801,20 +1549,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", "shasum": "" }, "require": { @@ -1823,7 +1571,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1864,7 +1612,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" }, "funding": [ { @@ -1880,20 +1628,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/process", - "version": "v5.4.26", + "version": "v5.4.28", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1a44dc377ec86a50fab40d066cd061e28a6b482f" + "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1a44dc377ec86a50fab40d066cd061e28a6b482f", - "reference": "1a44dc377ec86a50fab40d066cd061e28a6b482f", + "url": "https://api.github.com/repos/symfony/process/zipball/45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", + "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", "shasum": "" }, "require": { @@ -1926,7 +1674,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.26" + "source": "https://github.com/symfony/process/tree/v5.4.28" }, "funding": [ { @@ -1942,7 +1690,7 @@ "type": "tidelift" } ], - "time": "2023-07-12T15:44:31+00:00" + "time": "2023-08-07T10:36:04+00:00" }, { "name": "symfony/service-contracts", From 3c804daa2111b68e533b2a6f9f2868f6d5b39fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 3 Sep 2023 14:09:32 +0200 Subject: [PATCH 26/70] Fix: Require to pass name to ContainerBuilder::add() (#702) --- roave-bc-check.yaml | 2 + src/Faker/Container/ContainerBuilder.php | 15 +----- test/Faker/Extension/ContainerBuilderTest.php | 49 ++----------------- test/Faker/GeneratorTest.php | 2 +- 4 files changed, 8 insertions(+), 60 deletions(-) diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml index d515cae370..8d116c8eeb 100644 --- a/roave-bc-check.yaml +++ b/roave-bc-check.yaml @@ -16,3 +16,5 @@ parameters: - '#\[BC\] REMOVED: Class Faker\\Extension\\Container has been deleted#' - '#\[BC\] CHANGED: The parameter \$container of Faker\\Generator\#\_\_construct\(\) changed from Psr\\Container\\ContainerInterface\|null to a non-contravariant Faker\\Container\\ContainerInterface\|null#' - '#\[BC\] CHANGED: The parameter \$container of Faker\\Generator\#\_\_construct\(\) changed from Psr\\Container\\ContainerInterface\|null to Faker\\Container\\ContainerInterface\|null#' + - '#\[BC\] CHANGED: The number of required arguments for Faker\\Container\\ContainerBuilder\#add\(\) increased from 1 to 2#' + - '#\[BC\] CHANGED: The parameter \$name of Faker\\Container\\ContainerBuilder\#add\(\) changed from string\|null to a non-contravariant string#' diff --git a/src/Faker/Container/ContainerBuilder.php b/src/Faker/Container/ContainerBuilder.php index 3fb335fff5..96f02db19e 100644 --- a/src/Faker/Container/ContainerBuilder.php +++ b/src/Faker/Container/ContainerBuilder.php @@ -29,7 +29,7 @@ final class ContainerBuilder * * @throws \InvalidArgumentException */ - public function add($value, string $name = null): self + public function add($value, string $name): self { if (!is_string($value) && !is_callable($value) && !is_object($value)) { throw new \InvalidArgumentException(sprintf( @@ -38,19 +38,6 @@ public function add($value, string $name = null): self )); } - if ($name === null) { - if (is_string($value)) { - $name = $value; - } elseif (is_object($value)) { - $name = get_class($value); - } else { - throw new \InvalidArgumentException(sprintf( - 'Second argument to "%s::add()" is required not passing a string or object as first argument', - self::class, - )); - } - } - $this->definitions[$name] = $value; return $this; diff --git a/test/Faker/Extension/ContainerBuilderTest.php b/test/Faker/Extension/ContainerBuilderTest.php index 6f4bfc0c3a..02b64a2263 100644 --- a/test/Faker/Extension/ContainerBuilderTest.php +++ b/test/Faker/Extension/ContainerBuilderTest.php @@ -7,7 +7,6 @@ use Faker\Container\ContainerBuilder; use Faker\Container\ContainerInterface; use Faker\Core\File; -use Faker\Extension\Extension; use PHPUnit\Framework\TestCase; /** @@ -30,7 +29,7 @@ public function testAddRejectsInvalidValue($value): void ContainerBuilder::class, )); - $containerBuilder->add($value); + $containerBuilder->add($value, 'foo'); } /** @@ -59,46 +58,6 @@ public function provideInvalidValue(): \Generator } } - public function testAddRejectsNameWhenValueIsCallableAndNameIsNull(): void - { - $value = [ - new class() { - public static function create(): Extension - { - return new class() implements Extension { - }; - } - }, - 'create', - ]; - - $containerBuilder = new ContainerBuilder(); - - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf( - 'Second argument to "%s::add()" is required not passing a string or object as first argument', - ContainerBuilder::class, - )); - - $containerBuilder->add($value); - } - - public function testAddAcceptsValueWhenItIsAnObjectAndNameIsNull(): void - { - $value = new class() implements Extension {}; - - $name = get_class($value); - - $containerBuilder = new ContainerBuilder(); - - $containerBuilder->add($value); - - $container = $containerBuilder->build(); - - self::assertTrue($container->has($name)); - self::assertSame($value, $container->get($name)); - } - public function testBuildEmpty(): void { $builder = new ContainerBuilder(); @@ -112,7 +71,7 @@ public function testBuild(): void { $builder = new ContainerBuilder(); - $builder->add(File::class); + $builder->add(File::class, 'foo'); $container = $builder->build(); @@ -123,8 +82,8 @@ public function testBuildWithDuplicates(): void { $builder = new ContainerBuilder(); - $builder->add(File::class); - $builder->add(File::class); + $builder->add(File::class, 'foo'); + $builder->add(File::class, 'foo'); $container = $builder->build(); diff --git a/test/Faker/GeneratorTest.php b/test/Faker/GeneratorTest.php index 644a734819..d8e7b11f7d 100644 --- a/test/Faker/GeneratorTest.php +++ b/test/Faker/GeneratorTest.php @@ -145,7 +145,7 @@ public function testFormatterCallsGenerator(): void public function testFormatterCallsExtension(): void { $builder = new ContainerBuilder(); - $builder->add(Blood::class); + $builder->add(Blood::class, Blood::class); $faker = new Generator($builder->build()); $output = $faker->format('Faker\Core\Blood->bloodType'); From 3199539c2b97272d7cf3196ca5a6dd3a84c995fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 3 Sep 2023 14:09:49 +0200 Subject: [PATCH 27/70] Enhancement: Run tests in random order (#701) --- phpunit.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 37222a4ffe..050bdabe4e 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -7,6 +7,7 @@ cacheResultFile=".build/.phpunit.result.cache" colors="true" columns="max" + executionOrder="random" verbose="true" > From fb0d14770f8a00a77cfb79c5f6812d164bbb4d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 3 Sep 2023 14:10:04 +0200 Subject: [PATCH 28/70] Fix: Add property type declarations (#699) --- src/Faker/Container/Container.php | 4 ++-- src/Faker/Container/ContainerBuilder.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Faker/Container/Container.php b/src/Faker/Container/Container.php index 2dd2d974d7..409a7406a0 100644 --- a/src/Faker/Container/Container.php +++ b/src/Faker/Container/Container.php @@ -16,9 +16,9 @@ final class Container implements ContainerInterface /** * @var array */ - private $definitions; + private array $definitions; - private $services = []; + private array $services = []; /** * Create a container object with a set of definitions. The array value MUST diff --git a/src/Faker/Container/ContainerBuilder.php b/src/Faker/Container/ContainerBuilder.php index 96f02db19e..012554713c 100644 --- a/src/Faker/Container/ContainerBuilder.php +++ b/src/Faker/Container/ContainerBuilder.php @@ -22,7 +22,7 @@ final class ContainerBuilder /** * @var array */ - private $definitions = []; + private array $definitions = []; /** * @param callable|object|string $value From a337b82c45e705a617e69a7f1ce9dc97726c1838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 3 Sep 2023 14:40:43 +0200 Subject: [PATCH 29/70] Fix: Enable and configure type_declaration_spaces instead of deprecated function_typehint_space fixer (#698) --- .php-cs-fixer.dist.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 90a8d4feb8..968fb4a167 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -74,7 +74,6 @@ 'curly_braces_position' => true, 'declare_equal_normalize' => true, 'declare_parentheses' => true, - 'function_typehint_space' => true, 'general_phpdoc_annotation_remove' => [ 'annotations' => [ 'author', @@ -222,6 +221,11 @@ ], ], 'trim_array_spaces' => true, + 'type_declaration_spaces' => [ + 'elements' => [ + 'function', + ], + ], 'unary_operator_spaces' => true, 'visibility_required' => [ 'elements' => [ From 642833130506bba73fe6ffa33075e651727a84cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 14:26:28 +0200 Subject: [PATCH 30/70] composer(deps): bump phpstan/phpstan in /vendor-bin/phpstan (#704) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.32 to 1.10.33. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.10.32...1.10.33) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor-bin/phpstan/composer.json | 2 +- vendor-bin/phpstan/composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index e15922f664..c986b84bbf 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -2,7 +2,7 @@ "require": { "php": "^7.4 || ^8.0", "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.10.32", + "phpstan/phpstan": "^1.10.33", "phpstan/phpstan-deprecation-rules": "^1.1.4" }, "config": { diff --git a/vendor-bin/phpstan/composer.lock b/vendor-bin/phpstan/composer.lock index b7d79a163a..e29b1839e4 100644 --- a/vendor-bin/phpstan/composer.lock +++ b/vendor-bin/phpstan/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a9a13b1fedad6fc7cf7e70503054cbe2", + "content-hash": "91943fd0e93bcc879374e34731204c38", "packages": [ { "name": "phpstan/extension-installer", @@ -52,16 +52,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.32", + "version": "1.10.33", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44" + "reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c47e47d3ab03137c0e121e77c4d2cb58672f6d44", - "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1", + "reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1", "shasum": "" }, "require": { @@ -110,7 +110,7 @@ "type": "tidelift" } ], - "time": "2023-08-24T21:54:50+00:00" + "time": "2023-09-04T12:20:53+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", From 684564826ffe13921482bc5d7a5e3f75725f0477 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 14:26:35 +0200 Subject: [PATCH 31/70] composer(deps): bump friendsofphp/php-cs-fixer (#705) Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.25.0 to 3.25.1. - [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases) - [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md) - [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.25.0...v3.25.1) --- updated-dependencies: - dependency-name: friendsofphp/php-cs-fixer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor-bin/php-cs-fixer/composer.json | 2 +- vendor-bin/php-cs-fixer/composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/vendor-bin/php-cs-fixer/composer.json b/vendor-bin/php-cs-fixer/composer.json index b1249c7172..0ce16b6f26 100644 --- a/vendor-bin/php-cs-fixer/composer.json +++ b/vendor-bin/php-cs-fixer/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^7.4 || ^8.0", - "friendsofphp/php-cs-fixer": "^3.25.0" + "friendsofphp/php-cs-fixer": "^3.25.1" }, "config": { "platform": { diff --git a/vendor-bin/php-cs-fixer/composer.lock b/vendor-bin/php-cs-fixer/composer.lock index 5412f4cdde..8788bae2c2 100644 --- a/vendor-bin/php-cs-fixer/composer.lock +++ b/vendor-bin/php-cs-fixer/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7a2e6176d3f4126c9b59b213a71ccf35", + "content-hash": "7bbb231ca786bad9508912579f8f5346", "packages": [ { "name": "composer/pcre", @@ -226,16 +226,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.25.0", + "version": "v3.25.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d" + "reference": "8e21d69801de6b5ecb0dbe0bcdf967b335b1260b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d", - "reference": "9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/8e21d69801de6b5ecb0dbe0bcdf967b335b1260b", + "reference": "8e21d69801de6b5ecb0dbe0bcdf967b335b1260b", "shasum": "" }, "require": { @@ -309,7 +309,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.25.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.25.1" }, "funding": [ { @@ -317,7 +317,7 @@ "type": "github" } ], - "time": "2023-08-31T21:27:18+00:00" + "time": "2023-09-04T01:22:52+00:00" }, { "name": "psr/container", From cf1fd79881e9673aba3ecbe652081d4480914529 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 14:26:50 +0200 Subject: [PATCH 32/70] github-actions(deps): bump actions/checkout from 3 to 4 (#706) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/bc-check.yaml | 2 +- .github/workflows/branch-alias.yaml | 2 +- .github/workflows/code-coverage.yaml | 2 +- .github/workflows/coding-standards.yaml | 4 ++-- .github/workflows/rector.yaml | 2 +- .github/workflows/static-analysis.yaml | 4 ++-- .github/workflows/tests.yaml | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/bc-check.yaml b/.github/workflows/bc-check.yaml index 0e01cdafbf..60946927d4 100644 --- a/.github/workflows/bc-check.yaml +++ b/.github/workflows/bc-check.yaml @@ -14,7 +14,7 @@ jobs: steps: - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Roave BC Check" uses: "addnab/docker-run-action@v3" diff --git a/.github/workflows/branch-alias.yaml b/.github/workflows/branch-alias.yaml index 7370c88117..87d0cc0c2d 100644 --- a/.github/workflows/branch-alias.yaml +++ b/.github/workflows/branch-alias.yaml @@ -17,7 +17,7 @@ jobs: coverage: "none" - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" with: ref: "main" diff --git a/.github/workflows/code-coverage.yaml b/.github/workflows/code-coverage.yaml index d5fdf13ba7..a3ff6beeb7 100644 --- a/.github/workflows/code-coverage.yaml +++ b/.github/workflows/code-coverage.yaml @@ -20,7 +20,7 @@ jobs: steps: - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Install PHP with extensions" uses: "shivammathur/setup-php@v2" diff --git a/.github/workflows/coding-standards.yaml b/.github/workflows/coding-standards.yaml index a45413bf46..d1534f606f 100644 --- a/.github/workflows/coding-standards.yaml +++ b/.github/workflows/coding-standards.yaml @@ -20,7 +20,7 @@ jobs: steps: - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Set up PHP" uses: "shivammathur/setup-php@v2" @@ -68,7 +68,7 @@ jobs: steps: - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Lint YAML files" uses: "ibiqlik/action-yamllint@v3.1.1" diff --git a/.github/workflows/rector.yaml b/.github/workflows/rector.yaml index d17e34db07..647eb4a64c 100644 --- a/.github/workflows/rector.yaml +++ b/.github/workflows/rector.yaml @@ -20,7 +20,7 @@ jobs: steps: - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Set up PHP" uses: "shivammathur/setup-php@v2" diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index 54c28707a3..27b676cefd 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -18,7 +18,7 @@ jobs: steps: - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Set up PHP" uses: "shivammathur/setup-php@v2" @@ -59,7 +59,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Install PHP with extensions" uses: "shivammathur/setup-php@v2" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index bc6fa82dab..64807579bb 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -30,7 +30,7 @@ jobs: steps: - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Install PHP with extensions" uses: "shivammathur/setup-php@v2" From 6c3a043c0dc665a0f4bda4eca7010a2d9940e2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 15:42:15 +0200 Subject: [PATCH 33/70] Fix: Switch order of parameters (#703) --- roave-bc-check.yaml | 1 + src/Faker/Container/ContainerBuilder.php | 4 ++-- test/Faker/Extension/ContainerBuilderTest.php | 14 +++++++------- test/Faker/GeneratorTest.php | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml index 8d116c8eeb..ec55cb0747 100644 --- a/roave-bc-check.yaml +++ b/roave-bc-check.yaml @@ -18,3 +18,4 @@ parameters: - '#\[BC\] CHANGED: The parameter \$container of Faker\\Generator\#\_\_construct\(\) changed from Psr\\Container\\ContainerInterface\|null to Faker\\Container\\ContainerInterface\|null#' - '#\[BC\] CHANGED: The number of required arguments for Faker\\Container\\ContainerBuilder\#add\(\) increased from 1 to 2#' - '#\[BC\] CHANGED: The parameter \$name of Faker\\Container\\ContainerBuilder\#add\(\) changed from string\|null to a non-contravariant string#' + - '#\[BC\] CHANGED: The parameter \$value of Faker\\Container\\ContainerBuilder\#add\(\) changed from no type to a non-contravariant string#' diff --git a/src/Faker/Container/ContainerBuilder.php b/src/Faker/Container/ContainerBuilder.php index 012554713c..6a9c4747f0 100644 --- a/src/Faker/Container/ContainerBuilder.php +++ b/src/Faker/Container/ContainerBuilder.php @@ -29,7 +29,7 @@ final class ContainerBuilder * * @throws \InvalidArgumentException */ - public function add($value, string $name): self + public function add(string $name, $value): self { if (!is_string($value) && !is_callable($value) && !is_object($value)) { throw new \InvalidArgumentException(sprintf( @@ -71,7 +71,7 @@ public static function getDefault(): ContainerInterface $instance = new self(); foreach (self::defaultExtensions() as $id => $definition) { - $instance->add($definition, $id); + $instance->add($id, $definition); } return $instance->build(); diff --git a/test/Faker/Extension/ContainerBuilderTest.php b/test/Faker/Extension/ContainerBuilderTest.php index 02b64a2263..a86d81cde7 100644 --- a/test/Faker/Extension/ContainerBuilderTest.php +++ b/test/Faker/Extension/ContainerBuilderTest.php @@ -29,7 +29,7 @@ public function testAddRejectsInvalidValue($value): void ContainerBuilder::class, )); - $containerBuilder->add($value, 'foo'); + $containerBuilder->add('foo', $value); } /** @@ -71,7 +71,7 @@ public function testBuild(): void { $builder = new ContainerBuilder(); - $builder->add(File::class, 'foo'); + $builder->add('foo', File::class); $container = $builder->build(); @@ -82,8 +82,8 @@ public function testBuildWithDuplicates(): void { $builder = new ContainerBuilder(); - $builder->add(File::class, 'foo'); - $builder->add(File::class, 'foo'); + $builder->add('foo', File::class); + $builder->add('foo', File::class); $container = $builder->build(); @@ -94,7 +94,7 @@ public function testBuildWithObject(): void { $builder = new ContainerBuilder(); - $builder->add(new File(), 'foo'); + $builder->add('foo', new File()); $container = $builder->build(); @@ -105,9 +105,9 @@ public function testBuildWithCallable(): void { $builder = new ContainerBuilder(); - $builder->add(static function () { + $builder->add('foo', static function () { return new File(); - }, 'foo'); + }); $container = $builder->build(); diff --git a/test/Faker/GeneratorTest.php b/test/Faker/GeneratorTest.php index d8e7b11f7d..3adcf06534 100644 --- a/test/Faker/GeneratorTest.php +++ b/test/Faker/GeneratorTest.php @@ -135,7 +135,7 @@ public function testFormatTransfersArgumentsToFormatter(): void public function testFormatterCallsGenerator(): void { $builder = new ContainerBuilder(); - $builder->add(Blood::class, BloodExtension::class); + $builder->add(BloodExtension::class, Blood::class); $faker = new Generator($builder->build()); $output = $faker->format('bloodType'); From 67208f90b019f242b0a9833965974e0a0fa596de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 17:15:55 +0200 Subject: [PATCH 34/70] Fix: Remove unused method (#711) --- roave-bc-check.yaml | 2 ++ src/Faker/Container/Container.php | 8 -------- src/Faker/Container/ContainerInterface.php | 4 ---- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml index ec55cb0747..24ee17f2c8 100644 --- a/roave-bc-check.yaml +++ b/roave-bc-check.yaml @@ -19,3 +19,5 @@ parameters: - '#\[BC\] CHANGED: The number of required arguments for Faker\\Container\\ContainerBuilder\#add\(\) increased from 1 to 2#' - '#\[BC\] CHANGED: The parameter \$name of Faker\\Container\\ContainerBuilder\#add\(\) changed from string\|null to a non-contravariant string#' - '#\[BC\] CHANGED: The parameter \$value of Faker\\Container\\ContainerBuilder\#add\(\) changed from no type to a non-contravariant string#' + - '#\[BC\] REMOVED: Method Faker\\Container\\ContainerInterface\#getDefinitions\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Container\\Container\#getDefinitions\(\) was removed#' diff --git a/src/Faker/Container/Container.php b/src/Faker/Container/Container.php index 409a7406a0..4a79ea2272 100644 --- a/src/Faker/Container/Container.php +++ b/src/Faker/Container/Container.php @@ -134,12 +134,4 @@ public function has($id): bool return array_key_exists($id, $this->definitions); } - - /** - * Get the bindings between Extension interfaces and implementations. - */ - public function getDefinitions(): array - { - return $this->definitions; - } } diff --git a/src/Faker/Container/ContainerInterface.php b/src/Faker/Container/ContainerInterface.php index d34f4a8967..9e5237d341 100644 --- a/src/Faker/Container/ContainerInterface.php +++ b/src/Faker/Container/ContainerInterface.php @@ -6,8 +6,4 @@ interface ContainerInterface extends BaseContainerInterface { - /** - * Get the bindings between Extension interfaces and implementations. - */ - public function getDefinitions(): array; } From aca5898095fb5d3a3358fc91c0f0a1f32f1f6da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 17:16:16 +0200 Subject: [PATCH 35/70] Fix: Rename parameter (#707) --- src/Faker/Container/ContainerBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Faker/Container/ContainerBuilder.php b/src/Faker/Container/ContainerBuilder.php index 6a9c4747f0..eab78da402 100644 --- a/src/Faker/Container/ContainerBuilder.php +++ b/src/Faker/Container/ContainerBuilder.php @@ -29,7 +29,7 @@ final class ContainerBuilder * * @throws \InvalidArgumentException */ - public function add(string $name, $value): self + public function add(string $id, $value): self { if (!is_string($value) && !is_callable($value) && !is_object($value)) { throw new \InvalidArgumentException(sprintf( @@ -38,7 +38,7 @@ public function add(string $name, $value): self )); } - $this->definitions[$name] = $value; + $this->definitions[$id] = $value; return $this; } From 67190e9f952508428b5a8e7166040218a03a3796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 17:16:54 +0200 Subject: [PATCH 36/70] Fix: Add parameter type declaration (#710) --- src/Faker/Container/Container.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faker/Container/Container.php b/src/Faker/Container/Container.php index 4a79ea2272..5fd62948fc 100644 --- a/src/Faker/Container/Container.php +++ b/src/Faker/Container/Container.php @@ -81,7 +81,7 @@ public function get($id): Extension * * @param callable|object|string $definition */ - private function getService($id, $definition) + private function getService(string $id, $definition) { if (is_callable($definition)) { try { From c77a91ba6b9b814c11c12bd5ac515fc257a5d5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 17:18:55 +0200 Subject: [PATCH 37/70] Fix: Order (#712) --- roave-bc-check.yaml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml index 24ee17f2c8..df2e4ff216 100644 --- a/roave-bc-check.yaml +++ b/roave-bc-check.yaml @@ -1,23 +1,23 @@ parameters: ignoreErrors: - - '#\[BC\] CHANGED: Property Faker\\Provider\\[a-zA-Z]+::\$[1-9a-zA-Z]+ changed default value#' - - '#\[BC\] CHANGED: Property Faker\\Provider\\[a-z_A-Z]+\\[a-zA-Z]+::\$[1-9a-zA-Z]+ changed default value#' - '#\[BC\] CHANGED: Property Faker\\Factory::\$defaultProviders changed default value#' - - '#\[BC\] CHANGED: Type documentation for property Faker\\Provider\\en_ZA\\Internet::\$tld changed from having no type to array#' - - '#\[BC\] CHANGED: The parameter \$generator of Faker\\ValidGenerator\#\_\_construct\(\) changed from Faker\\Generator to no type#' - - '#\[BC\] CHANGED: The parameter \$generator of Faker\\UniqueGenerator\#\_\_construct\(\) changed from Faker\\Generator to no type#' - - '#\[BC\] CHANGED: The return type of Faker\\Extension\\PersonExtension\#name\(\) changed from no type to string#' - - '#\[BC\] CHANGED: The parameter \$max of Faker\\Extension\\NumberExtension\#randomFloat\(\) changed from float to float\|null#' - - '#\[BC\] REMOVED: Method Faker\\Generator\#uuid\(\) was removed#' - - '#\[BC\] REMOVED: Method Faker\\Generator\#uuid3\(\) was removed#' - - '#\[BC\] REMOVED: Class Faker\\Extension\\ContainerException has been deleted#' - - '#\[BC\] REMOVED: Class Faker\\Extension\\NotInContainerException has been deleted#' - - '#\[BC\] REMOVED: Class Faker\\Extension\\ContainerBuilder has been deleted#' - - '#\[BC\] REMOVED: Class Faker\\Extension\\Container has been deleted#' + - '#\[BC\] CHANGED: Property Faker\\Provider\\[a-z_A-Z]+\\[a-zA-Z]+::\$[1-9a-zA-Z]+ changed default value#' + - '#\[BC\] CHANGED: Property Faker\\Provider\\[a-zA-Z]+::\$[1-9a-zA-Z]+ changed default value#' + - '#\[BC\] CHANGED: The number of required arguments for Faker\\Container\\ContainerBuilder\#add\(\) increased from 1 to 2#' - '#\[BC\] CHANGED: The parameter \$container of Faker\\Generator\#\_\_construct\(\) changed from Psr\\Container\\ContainerInterface\|null to a non-contravariant Faker\\Container\\ContainerInterface\|null#' - '#\[BC\] CHANGED: The parameter \$container of Faker\\Generator\#\_\_construct\(\) changed from Psr\\Container\\ContainerInterface\|null to Faker\\Container\\ContainerInterface\|null#' - - '#\[BC\] CHANGED: The number of required arguments for Faker\\Container\\ContainerBuilder\#add\(\) increased from 1 to 2#' + - '#\[BC\] CHANGED: The parameter \$generator of Faker\\UniqueGenerator\#\_\_construct\(\) changed from Faker\\Generator to no type#' + - '#\[BC\] CHANGED: The parameter \$generator of Faker\\ValidGenerator\#\_\_construct\(\) changed from Faker\\Generator to no type#' + - '#\[BC\] CHANGED: The parameter \$max of Faker\\Extension\\NumberExtension\#randomFloat\(\) changed from float to float\|null#' - '#\[BC\] CHANGED: The parameter \$name of Faker\\Container\\ContainerBuilder\#add\(\) changed from string\|null to a non-contravariant string#' - '#\[BC\] CHANGED: The parameter \$value of Faker\\Container\\ContainerBuilder\#add\(\) changed from no type to a non-contravariant string#' - - '#\[BC\] REMOVED: Method Faker\\Container\\ContainerInterface\#getDefinitions\(\) was removed#' + - '#\[BC\] CHANGED: The return type of Faker\\Extension\\PersonExtension\#name\(\) changed from no type to string#' + - '#\[BC\] CHANGED: Type documentation for property Faker\\Provider\\en_ZA\\Internet::\$tld changed from having no type to array#' + - '#\[BC\] REMOVED: Class Faker\\Extension\\Container has been deleted#' + - '#\[BC\] REMOVED: Class Faker\\Extension\\ContainerBuilder has been deleted#' + - '#\[BC\] REMOVED: Class Faker\\Extension\\ContainerException has been deleted#' + - '#\[BC\] REMOVED: Class Faker\\Extension\\NotInContainerException has been deleted#' - '#\[BC\] REMOVED: Method Faker\\Container\\Container\#getDefinitions\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Container\\ContainerInterface\#getDefinitions\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Generator\#uuid3\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Generator\#uuid\(\) was removed#' From c48baf513e6661201aa77a293c955290f615b004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 18:04:27 +0200 Subject: [PATCH 38/70] Enhancement: Reuse NumberExtension (#715) --- src/Faker/Core/Barcode.php | 9 ++++++++- src/Faker/Core/Color.php | 35 ++++++++++++++++------------------ src/Faker/Core/Coordinates.php | 13 ++++++++++--- src/Faker/Core/Number.php | 10 +++++----- src/Faker/Core/Uuid.php | 16 +++++++++++----- src/Faker/Core/Version.php | 32 ++++++++++++++++++------------- 6 files changed, 69 insertions(+), 46 deletions(-) diff --git a/src/Faker/Core/Barcode.php b/src/Faker/Core/Barcode.php index 89f801a5a0..a85420be90 100644 --- a/src/Faker/Core/Barcode.php +++ b/src/Faker/Core/Barcode.php @@ -12,6 +12,13 @@ */ final class Barcode implements Extension\BarcodeExtension { + private Extension\NumberExtension $numberExtension; + + public function __construct(Extension\NumberExtension $numberExtension = null) + { + $this->numberExtension = $numberExtension ?: new Number(); + } + private function ean(int $length = 13): string { $code = Extension\Helper::numerify(str_repeat('#', $length - 1)); @@ -38,7 +45,7 @@ public function isbn10(): string public function isbn13(): string { - $code = '97' . mt_rand(8, 9) . Extension\Helper::numerify(str_repeat('#', 9)); + $code = '97' . $this->numberExtension->numberBetween(8, 9) . Extension\Helper::numerify(str_repeat('#', 9)); return sprintf('%s%s', $code, Calculator\Ean::checksum($code)); } diff --git a/src/Faker/Core/Color.php b/src/Faker/Core/Color.php index 6e4e350e6d..7b1d7fc44d 100644 --- a/src/Faker/Core/Color.php +++ b/src/Faker/Core/Color.php @@ -12,6 +12,8 @@ */ final class Color implements Extension\ColorExtension { + private Extension\NumberExtension $numberExtension; + /** * @var string[] */ @@ -20,7 +22,6 @@ final class Color implements Extension\ColorExtension 'purple', 'teal', 'lime', 'blue', 'silver', 'gray', 'yellow', 'fuchsia', 'aqua', 'white', ]; - /** * @var string[] */ @@ -53,14 +54,17 @@ final class Color implements Extension\ColorExtension 'Turquoise', 'Violet', 'Wheat', 'White', 'WhiteSmoke', 'Yellow', 'YellowGreen', ]; + public function __construct(Extension\NumberExtension $numberExtension = null) + { + $this->numberExtension = $numberExtension ?: new Number(); + } + /** * @example '#fa3cc2' */ public function hexColor(): string { - $number = new Number(); - - return '#' . str_pad(dechex($number->numberBetween(1, 16777215)), 6, '0', STR_PAD_LEFT); + return '#' . str_pad(dechex($this->numberExtension->numberBetween(1, 16777215)), 6, '0', STR_PAD_LEFT); } /** @@ -68,8 +72,7 @@ public function hexColor(): string */ public function safeHexColor(): string { - $number = new Number(); - $color = str_pad(dechex($number->numberBetween(0, 255)), 3, '0', STR_PAD_LEFT); + $color = str_pad(dechex($this->numberExtension->numberBetween(0, 255)), 3, '0', STR_PAD_LEFT); return sprintf( '#%s%s%s%s%s%s', @@ -122,12 +125,10 @@ public function rgbCssColor(): string */ public function rgbaCssColor(): string { - $number = new Number(); - return sprintf( 'rgba(%s,%s)', $this->rgbColor(), - $number->randomFloat(1, 0, 1), + $this->numberExtension->randomFloat(1, 0, 1), ); } @@ -152,13 +153,11 @@ public function colorName(): string */ public function hslColor(): string { - $number = new Number(); - return sprintf( '%s,%s,%s', - $number->numberBetween(0, 360), - $number->numberBetween(0, 100), - $number->numberBetween(0, 100), + $this->numberExtension->numberBetween(0, 360), + $this->numberExtension->numberBetween(0, 100), + $this->numberExtension->numberBetween(0, 100), ); } @@ -169,12 +168,10 @@ public function hslColor(): string */ public function hslColorAsArray(): array { - $number = new Number(); - return [ - $number->numberBetween(0, 360), - $number->numberBetween(0, 100), - $number->numberBetween(0, 100), + $this->numberExtension->numberBetween(0, 360), + $this->numberExtension->numberBetween(0, 100), + $this->numberExtension->numberBetween(0, 100), ]; } } diff --git a/src/Faker/Core/Coordinates.php b/src/Faker/Core/Coordinates.php index 40a26589f7..6d27b22f3f 100644 --- a/src/Faker/Core/Coordinates.php +++ b/src/Faker/Core/Coordinates.php @@ -4,10 +4,17 @@ namespace Faker\Core; -use Faker\Extension\Extension; +use Faker\Extension; -class Coordinates implements Extension +class Coordinates implements Extension\Extension { + private Extension\NumberExtension $numberExtension; + + public function __construct(Extension\NumberExtension $numberExtension = null) + { + $this->numberExtension = $numberExtension ?: new Number(); + } + /** * @example '77.147489' * @@ -63,6 +70,6 @@ private function randomFloat(int $nbMaxDecimals, float $min, float $max): float throw new \LogicException('Invalid coordinates boundaries'); } - return round($min + mt_rand() / mt_getrandmax() * ($max - $min), $nbMaxDecimals); + return $this->numberExtension->randomFloat($nbMaxDecimals, $min, $max); } } diff --git a/src/Faker/Core/Number.php b/src/Faker/Core/Number.php index f67c042675..866d02fbe5 100644 --- a/src/Faker/Core/Number.php +++ b/src/Faker/Core/Number.php @@ -21,7 +21,7 @@ public function numberBetween(int $min = 0, int $max = 2147483647): int public function randomDigit(): int { - return mt_rand(0, 9); + return $this->numberBetween(0, 9); } public function randomDigitNot(int $except): int @@ -37,7 +37,7 @@ public function randomDigitNot(int $except): int public function randomDigitNotZero(): int { - return mt_rand(1, 9); + return $this->numberBetween(1, 9); } public function randomFloat(?int $nbMaxDecimals = null, float $min = 0, ?float $max = null): float @@ -60,7 +60,7 @@ public function randomFloat(?int $nbMaxDecimals = null, float $min = 0, ?float $ $max = $tmp; } - return round($min + mt_rand() / mt_getrandmax() * ($max - $min), $nbMaxDecimals); + return round($min + $this->numberBetween() / mt_getrandmax() * ($max - $min), $nbMaxDecimals); } public function randomNumber(int $nbDigits = null, bool $strict = false): int @@ -75,9 +75,9 @@ public function randomNumber(int $nbDigits = null, bool $strict = false): int } if ($strict) { - return mt_rand(10 ** ($nbDigits - 1), $max); + return $this->numberBetween(10 ** ($nbDigits - 1), $max); } - return mt_rand(0, $max); + return $this->numberBetween(0, $max); } } diff --git a/src/Faker/Core/Uuid.php b/src/Faker/Core/Uuid.php index 5e3b633a26..f9f595e0cd 100644 --- a/src/Faker/Core/Uuid.php +++ b/src/Faker/Core/Uuid.php @@ -2,17 +2,23 @@ namespace Faker\Core; -use Faker\Extension\UuidExtension; +use Faker\Extension; -final class Uuid implements UuidExtension +final class Uuid implements Extension\UuidExtension { - public function uuid3(): string + private Extension\NumberExtension $numberExtension; + + public function __construct(Extension\NumberExtension $numberExtension = null) { - $number = new Number(); + $this->numberExtension = $numberExtension ?: new Number(); + } + + public function uuid3(): string + { // fix for compatibility with 32bit architecture; each mt_rand call is restricted to 32bit // two such calls will cause 64bits of randomness regardless of architecture - $seed = $number->numberBetween(0, 2147483647) . '#' . $number->numberBetween(0, 2147483647); + $seed = $this->numberExtension->numberBetween(0, 2147483647) . '#' . $this->numberExtension->numberBetween(0, 2147483647); // Hash the seed and convert to a byte array $val = md5($seed, true); diff --git a/src/Faker/Core/Version.php b/src/Faker/Core/Version.php index f5e7cf5a08..db6ee836d1 100644 --- a/src/Faker/Core/Version.php +++ b/src/Faker/Core/Version.php @@ -4,17 +4,23 @@ namespace Faker\Core; -use Faker\Extension\Helper; -use Faker\Extension\VersionExtension; +use Faker\Extension; use Faker\Provider\DateTime; -final class Version implements VersionExtension +final class Version implements Extension\VersionExtension { + private Extension\NumberExtension $numberExtension; /** * @var string[] */ private $semverCommonPreReleaseIdentifiers = ['alpha', 'beta', 'rc']; + public function __construct(Extension\NumberExtension $numberExtension = null) + { + + $this->numberExtension = $numberExtension ?: new Number(); + } + /** * Represents v2.0.0 of the semantic versioning: https://semver.org/spec/v2.0.0.html */ @@ -22,11 +28,11 @@ public function semver(bool $preRelease = false, bool $build = false): string { return sprintf( '%d.%d.%d%s%s', - mt_rand(0, 9), - mt_rand(0, 99), - mt_rand(0, 99), - $preRelease && mt_rand(0, 1) === 1 ? '-' . $this->semverPreReleaseIdentifier() : '', - $build && mt_rand(0, 1) === 1 ? '+' . $this->semverBuildIdentifier() : '', + $this->numberExtension->numberBetween(0, 9), + $this->numberExtension->numberBetween(0, 99), + $this->numberExtension->numberBetween(0, 99), + $preRelease && $this->numberExtension->numberBetween(0, 1) === 1 ? '-' . $this->semverPreReleaseIdentifier() : '', + $build && $this->numberExtension->numberBetween(0, 1) === 1 ? '+' . $this->semverBuildIdentifier() : '', ); } @@ -35,13 +41,13 @@ public function semver(bool $preRelease = false, bool $build = false): string */ private function semverPreReleaseIdentifier(): string { - $ident = Helper::randomElement($this->semverCommonPreReleaseIdentifiers); + $ident = Extension\Helper::randomElement($this->semverCommonPreReleaseIdentifiers); - if (mt_rand(0, 1) !== 1) { + if ($this->numberExtension->numberBetween(0, 1) !== 1) { return $ident; } - return $ident . '.' . mt_rand(1, 99); + return $ident . '.' . $this->numberExtension->numberBetween(1, 99); } /** @@ -49,9 +55,9 @@ private function semverPreReleaseIdentifier(): string */ private function semverBuildIdentifier(): string { - if (mt_rand(0, 1) === 1) { + if ($this->numberExtension->numberBetween(0, 1) === 1) { // short git revision syntax: https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection - return substr(sha1(Helper::lexify('??????')), 0, 7); + return substr(sha1(Extension\Helper::lexify('??????')), 0, 7); } // date syntax From 7f6fb67f74a256e97fa67840e3453f4c9f28ed8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 18:04:47 +0200 Subject: [PATCH 39/70] Fix: Methods are instance methods (#708) --- src/Faker/Core/Coordinates.php | 4 ++-- src/Faker/Core/Number.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Faker/Core/Coordinates.php b/src/Faker/Core/Coordinates.php index 6d27b22f3f..9b8b9dd354 100644 --- a/src/Faker/Core/Coordinates.php +++ b/src/Faker/Core/Coordinates.php @@ -59,8 +59,8 @@ public function longitude(float $min = -180.0, float $max = 180.0): float public function localCoordinates(): array { return [ - 'latitude' => static::latitude(), - 'longitude' => static::longitude(), + 'latitude' => $this->latitude(), + 'longitude' => $this->longitude(), ]; } diff --git a/src/Faker/Core/Number.php b/src/Faker/Core/Number.php index 866d02fbe5..a16920c936 100644 --- a/src/Faker/Core/Number.php +++ b/src/Faker/Core/Number.php @@ -26,7 +26,7 @@ public function randomDigit(): int public function randomDigitNot(int $except): int { - $result = self::numberBetween(0, 8); + $result = $this->numberBetween(0, 8); if ($result >= $except) { ++$result; From 404d06b0590bb24a84e21e82c8151e83326d8b0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 18:05:17 +0200 Subject: [PATCH 40/70] Fix: Add property type declarations (#713) --- src/Faker/Core/Blood.php | 4 ++-- src/Faker/Core/Color.php | 4 ++-- src/Faker/Core/DateTime.php | 7 ++----- src/Faker/Core/File.php | 2 +- src/Faker/Core/Version.php | 2 +- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/Faker/Core/Blood.php b/src/Faker/Core/Blood.php index 50a5806c6b..03e563fc12 100644 --- a/src/Faker/Core/Blood.php +++ b/src/Faker/Core/Blood.php @@ -14,12 +14,12 @@ final class Blood implements Extension\BloodExtension /** * @var string[] */ - private $bloodTypes = ['A', 'AB', 'B', 'O']; + private array $bloodTypes = ['A', 'AB', 'B', 'O']; /** * @var string[] */ - private $bloodRhFactors = ['+', '-']; + private array $bloodRhFactors = ['+', '-']; public function bloodType(): string { diff --git a/src/Faker/Core/Color.php b/src/Faker/Core/Color.php index 7b1d7fc44d..bd94819013 100644 --- a/src/Faker/Core/Color.php +++ b/src/Faker/Core/Color.php @@ -17,7 +17,7 @@ final class Color implements Extension\ColorExtension /** * @var string[] */ - private $safeColorNames = [ + private array $safeColorNames = [ 'black', 'maroon', 'green', 'navy', 'olive', 'purple', 'teal', 'lime', 'blue', 'silver', 'gray', 'yellow', 'fuchsia', 'aqua', 'white', @@ -25,7 +25,7 @@ final class Color implements Extension\ColorExtension /** * @var string[] */ - private $allColorNames = [ + private array $allColorNames = [ 'AliceBlue', 'AntiqueWhite', 'Aqua', 'Aquamarine', 'Azure', 'Beige', 'Bisque', 'Black', 'BlanchedAlmond', 'Blue', 'BlueViolet', 'Brown', 'BurlyWood', 'CadetBlue', diff --git a/src/Faker/Core/DateTime.php b/src/Faker/Core/DateTime.php index f3d7877654..307c9fd44d 100644 --- a/src/Faker/Core/DateTime.php +++ b/src/Faker/Core/DateTime.php @@ -19,12 +19,9 @@ final class DateTime implements DateTimeExtension, GeneratorAwareExtension /** * @var string[] */ - private $centuries = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', 'XXI']; + private array $centuries = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', 'XXI']; - /** - * @var string - */ - private $defaultTimezone = null; + private ?string $defaultTimezone = null; /** * Get the POSIX-timestamp of a DateTime, int or string. diff --git a/src/Faker/Core/File.php b/src/Faker/Core/File.php index adddb0cb33..5151e900f3 100644 --- a/src/Faker/Core/File.php +++ b/src/Faker/Core/File.php @@ -18,7 +18,7 @@ final class File implements Extension\FileExtension * * @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types */ - private $mimeTypes = [ + private array $mimeTypes = [ 'application/atom+xml' => 'atom', 'application/ecmascript' => 'ecma', 'application/emma+xml' => 'emma', diff --git a/src/Faker/Core/Version.php b/src/Faker/Core/Version.php index db6ee836d1..9618888c9e 100644 --- a/src/Faker/Core/Version.php +++ b/src/Faker/Core/Version.php @@ -13,7 +13,7 @@ final class Version implements Extension\VersionExtension /** * @var string[] */ - private $semverCommonPreReleaseIdentifiers = ['alpha', 'beta', 'rc']; + private array $semverCommonPreReleaseIdentifiers = ['alpha', 'beta', 'rc']; public function __construct(Extension\NumberExtension $numberExtension = null) { From e0623f66bd8468633ed5d4177672e67f203ae304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 18:05:52 +0200 Subject: [PATCH 41/70] Fix: Reduce visibility (#714) * Fix: Reduce visibility * Fix: Remove unused methods --- roave-bc-check.yaml | 6 ++++++ src/Faker/Core/DateTime.php | 18 ++++-------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml index df2e4ff216..66a2326399 100644 --- a/roave-bc-check.yaml +++ b/roave-bc-check.yaml @@ -19,5 +19,11 @@ parameters: - '#\[BC\] REMOVED: Class Faker\\Extension\\NotInContainerException has been deleted#' - '#\[BC\] REMOVED: Method Faker\\Container\\Container\#getDefinitions\(\) was removed#' - '#\[BC\] REMOVED: Method Faker\\Container\\ContainerInterface\#getDefinitions\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#getDefaultTimezone\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#getTimestamp\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#getTimestampDateTime\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#resolveTimezone\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#setDefaultTimezone\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#setTimezone\(\) was removed#' - '#\[BC\] REMOVED: Method Faker\\Generator\#uuid3\(\) was removed#' - '#\[BC\] REMOVED: Method Faker\\Generator\#uuid\(\) was removed#' diff --git a/src/Faker/Core/DateTime.php b/src/Faker/Core/DateTime.php index 307c9fd44d..9f89d022c0 100644 --- a/src/Faker/Core/DateTime.php +++ b/src/Faker/Core/DateTime.php @@ -30,7 +30,7 @@ final class DateTime implements DateTimeExtension, GeneratorAwareExtension * * @return false|int */ - protected function getTimestamp($until = 'now') + private function getTimestamp($until = 'now') { if (is_numeric($until)) { return (int) $until; @@ -48,22 +48,12 @@ protected function getTimestamp($until = 'now') * * @param int $timestamp the UNIX / POSIX-compatible timestamp */ - protected function getTimestampDateTime(int $timestamp): \DateTime + private function getTimestampDateTime(int $timestamp): \DateTime { return new \DateTime('@' . $timestamp); } - protected function setDefaultTimezone(string $timezone = null): void - { - $this->defaultTimezone = $timezone; - } - - protected function getDefaultTimezone(): ?string - { - return $this->defaultTimezone; - } - - protected function resolveTimezone(?string $timezone): string + private function resolveTimezone(?string $timezone): string { if ($timezone !== null) { return $timezone; @@ -75,7 +65,7 @@ protected function resolveTimezone(?string $timezone): string /** * Internal method to set the timezone on a DateTime object. */ - protected function setTimezone(\DateTime $dateTime, ?string $timezone): \DateTime + private function setTimezone(\DateTime $dateTime, ?string $timezone): \DateTime { $timezone = $this->resolveTimezone($timezone); From 1990f9239f2632c285179e9711a62e9419c247a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 18:06:25 +0200 Subject: [PATCH 42/70] Fix: Do not memoize invalid service (#709) * Enhancement: Assert that Container throws on second attempt to retrieve service * Fix: Do not memoize invalid service --- src/Faker/Container/Container.php | 4 +++- test/Faker/Extension/ContainerTest.php | 27 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/Faker/Container/Container.php b/src/Faker/Container/Container.php index 5fd62948fc..9b361845f2 100644 --- a/src/Faker/Container/Container.php +++ b/src/Faker/Container/Container.php @@ -63,7 +63,7 @@ public function get($id): Extension $definition = $this->definitions[$id]; - $service = $this->services[$id] = $this->getService($id, $definition); + $service = $this->getService($id, $definition); if (!$service instanceof Extension) { throw new \RuntimeException(sprintf( @@ -73,6 +73,8 @@ public function get($id): Extension )); } + $this->services[$id] = $service; + return $service; } diff --git a/test/Faker/Extension/ContainerTest.php b/test/Faker/Extension/ContainerTest.php index f1158d4aef..a4ed7b233f 100644 --- a/test/Faker/Extension/ContainerTest.php +++ b/test/Faker/Extension/ContainerTest.php @@ -64,6 +64,33 @@ public function testGetThrowsRuntimeExceptionWhenServiceResolvedForIdentifierIsN $container->get($id); } + /** + * @dataProvider provideDefinitionThatDoesNotResolveToExtension + */ + public function testGetThrowsRuntimeExceptionWhenServiceResolvedForIdentifierIsNotAnExtensionOnSecondTry($definition): void + { + $id = 'file'; + + $container = new Container([ + $id => $definition, + ]); + + try { + $container->get($id); + } catch (\RuntimeException $e) { + // do nothing + } + + $this->expectException(\RuntimeException::class); + $this->expectExceptionMessage(sprintf( + 'Service resolved for identifier "%s" does not implement the %s" interface.', + $id, + Extension::class, + )); + + $container->get($id); + } + /** * @return \Generator */ From edb6523b53e308e95de340fcab56c4947910d840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 18:56:09 +0200 Subject: [PATCH 43/70] Fix: Consistently describe experimental status (#717) --- src/Faker/Core/DateTime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faker/Core/DateTime.php b/src/Faker/Core/DateTime.php index 9f89d022c0..6ef40a9667 100644 --- a/src/Faker/Core/DateTime.php +++ b/src/Faker/Core/DateTime.php @@ -8,7 +8,7 @@ use Faker\Extension\Helper; /** - * @experimental + * @experimental This class is experimental and does not fall under our BC promise * * @since 1.20.0 */ From e0c22feba0db144e345a0a1cdd010d6cba40000f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 18:56:25 +0200 Subject: [PATCH 44/70] Fix: Mark classes as experimental (#716) --- src/Faker/Core/Coordinates.php | 3 +++ src/Faker/Core/Uuid.php | 3 +++ src/Faker/Core/Version.php | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/Faker/Core/Coordinates.php b/src/Faker/Core/Coordinates.php index 9b8b9dd354..19b58f95a7 100644 --- a/src/Faker/Core/Coordinates.php +++ b/src/Faker/Core/Coordinates.php @@ -6,6 +6,9 @@ use Faker\Extension; +/** + * @experimental This class is experimental and does not fall under our BC promise + */ class Coordinates implements Extension\Extension { private Extension\NumberExtension $numberExtension; diff --git a/src/Faker/Core/Uuid.php b/src/Faker/Core/Uuid.php index f9f595e0cd..d1db1b2292 100644 --- a/src/Faker/Core/Uuid.php +++ b/src/Faker/Core/Uuid.php @@ -4,6 +4,9 @@ use Faker\Extension; +/** + * @experimental This class is experimental and does not fall under our BC promise + */ final class Uuid implements Extension\UuidExtension { private Extension\NumberExtension $numberExtension; diff --git a/src/Faker/Core/Version.php b/src/Faker/Core/Version.php index 9618888c9e..8863c480a2 100644 --- a/src/Faker/Core/Version.php +++ b/src/Faker/Core/Version.php @@ -7,6 +7,9 @@ use Faker\Extension; use Faker\Provider\DateTime; +/** + * @experimental This class is experimental and does not fall under our BC promise + */ final class Version implements Extension\VersionExtension { private Extension\NumberExtension $numberExtension; From 1f83b6801f2ad3da7f41fde87bc2a29d38a198e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 18:58:56 +0200 Subject: [PATCH 45/70] Fix: Mark class as final (#718) --- roave-bc-check.yaml | 1 + src/Faker/Core/Coordinates.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml index 66a2326399..610c9e4e2f 100644 --- a/roave-bc-check.yaml +++ b/roave-bc-check.yaml @@ -1,5 +1,6 @@ parameters: ignoreErrors: + - '#\[BC\] CHANGED: Class Faker\\Core\\Coordinates became final#' - '#\[BC\] CHANGED: Property Faker\\Factory::\$defaultProviders changed default value#' - '#\[BC\] CHANGED: Property Faker\\Provider\\[a-z_A-Z]+\\[a-zA-Z]+::\$[1-9a-zA-Z]+ changed default value#' - '#\[BC\] CHANGED: Property Faker\\Provider\\[a-zA-Z]+::\$[1-9a-zA-Z]+ changed default value#' diff --git a/src/Faker/Core/Coordinates.php b/src/Faker/Core/Coordinates.php index 19b58f95a7..15b5492e17 100644 --- a/src/Faker/Core/Coordinates.php +++ b/src/Faker/Core/Coordinates.php @@ -9,7 +9,7 @@ /** * @experimental This class is experimental and does not fall under our BC promise */ -class Coordinates implements Extension\Extension +final class Coordinates implements Extension\Extension { private Extension\NumberExtension $numberExtension; From dd8df33d504ec3069a992d1ea513341a6384ee83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 22:18:20 +0200 Subject: [PATCH 46/70] Fix: Return string (#726) --- phpstan-baseline.neon | 5 ----- psalm.baseline.xml | 8 -------- src/Faker/Calculator/Luhn.php | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index a9b8f8536c..f5e829a001 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -15,11 +15,6 @@ parameters: count: 1 path: src/Faker/Calculator/Luhn.php - - - message: "#^Method Faker\\\\Calculator\\\\Luhn\\:\\:computeCheckDigit\\(\\) should return string but returns int\\.$#" - count: 1 - path: src/Faker/Calculator/Luhn.php - - message: "#^Result of && is always false\\.$#" count: 1 diff --git a/psalm.baseline.xml b/psalm.baseline.xml index ee068ecd7d..7ee4975b70 100644 --- a/psalm.baseline.xml +++ b/psalm.baseline.xml @@ -1,13 +1,5 @@ - - - 0 - - - string - - uniqueGenerator]]> diff --git a/src/Faker/Calculator/Luhn.php b/src/Faker/Calculator/Luhn.php index 3a048fb082..0327668e53 100644 --- a/src/Faker/Calculator/Luhn.php +++ b/src/Faker/Calculator/Luhn.php @@ -44,7 +44,7 @@ public static function computeCheckDigit($partialNumber) $checkDigit = self::checksum($partialNumber . '0'); if ($checkDigit === 0) { - return 0; + return '0'; } return (string) (10 - $checkDigit); From 68336bb152011d5425364e129e5e8c0ec825bafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 22:24:07 +0200 Subject: [PATCH 47/70] Fix: Order (#722) --- src/Faker/Container/ContainerBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faker/Container/ContainerBuilder.php b/src/Faker/Container/ContainerBuilder.php index eab78da402..940ab39638 100644 --- a/src/Faker/Container/ContainerBuilder.php +++ b/src/Faker/Container/ContainerBuilder.php @@ -61,8 +61,8 @@ public static function defaultExtensions(): array DateTimeExtension::class => Core\DateTime::class, FileExtension::class => Core\File::class, NumberExtension::class => Core\Number::class, - VersionExtension::class => Core\Version::class, UuidExtension::class => Core\Uuid::class, + VersionExtension::class => Core\Version::class, ]; } From 1ba2598081b1b5a1b585decc327d020235710398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 4 Sep 2023 23:00:16 +0200 Subject: [PATCH 48/70] Fix: Avoid unnecessary imports (#721) --- src/Faker/Container/ContainerBuilder.php | 25 +++++++++--------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/Faker/Container/ContainerBuilder.php b/src/Faker/Container/ContainerBuilder.php index 940ab39638..8b2223d522 100644 --- a/src/Faker/Container/ContainerBuilder.php +++ b/src/Faker/Container/ContainerBuilder.php @@ -5,14 +5,7 @@ namespace Faker\Container; use Faker\Core; -use Faker\Extension\BarcodeExtension; -use Faker\Extension\BloodExtension; -use Faker\Extension\ColorExtension; -use Faker\Extension\DateTimeExtension; -use Faker\Extension\FileExtension; -use Faker\Extension\NumberExtension; -use Faker\Extension\UuidExtension; -use Faker\Extension\VersionExtension; +use Faker\Extension; /** * @experimental This class is experimental and does not fall under our BC promise @@ -55,14 +48,14 @@ public function build(): ContainerInterface public static function defaultExtensions(): array { return [ - BarcodeExtension::class => Core\Barcode::class, - BloodExtension::class => Core\Blood::class, - ColorExtension::class => Core\Color::class, - DateTimeExtension::class => Core\DateTime::class, - FileExtension::class => Core\File::class, - NumberExtension::class => Core\Number::class, - UuidExtension::class => Core\Uuid::class, - VersionExtension::class => Core\Version::class, + Extension\BarcodeExtension::class => Core\Barcode::class, + Extension\BloodExtension::class => Core\Blood::class, + Extension\ColorExtension::class => Core\Color::class, + Extension\DateTimeExtension::class => Core\DateTime::class, + Extension\FileExtension::class => Core\File::class, + Extension\NumberExtension::class => Core\Number::class, + Extension\UuidExtension::class => Core\Uuid::class, + Extension\VersionExtension::class => Core\Version::class, ]; } From 31c68422143e43238ace8f79efe819442efa4edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Sep 2023 09:53:21 +0200 Subject: [PATCH 49/70] Enhancement: Enable `self_static_accessor` fixer (#728) * Enhancement: Enable self_static_accessor fixer * Fix: Run 'make cs' --- .php-cs-fixer.dist.php | 1 + src/Faker/Extension/Helper.php | 2 +- test/Faker/Provider/ProviderOverrideTest.php | 38 ++++++++++---------- test/Faker/Provider/id_ID/PersonTest.php | 2 +- test/Faker/Provider/ro_RO/PersonTest.php | 2 +- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 968fb4a167..f6ebd33afd 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -187,6 +187,7 @@ 'random_api_migration' => true, 'return_assignment' => true, 'return_type_declaration' => true, + 'self_static_accessor' => true, 'semicolon_after_instruction' => true, 'short_scalar_cast' => true, 'single_line_comment_style' => true, diff --git a/src/Faker/Extension/Helper.php b/src/Faker/Extension/Helper.php index d6245313f9..47200e90c6 100644 --- a/src/Faker/Extension/Helper.php +++ b/src/Faker/Extension/Helper.php @@ -86,7 +86,7 @@ public static function bothify(string $string): string return mt_rand(0, 1) === 1 ? '#' : '?'; }); - return static::lexify(static::numerify($string)); + return self::lexify(self::numerify($string)); } private static function replaceWildcard(string $string, string $wildcard, callable $callback): string diff --git a/test/Faker/Provider/ProviderOverrideTest.php b/test/Faker/Provider/ProviderOverrideTest.php index de07e803b6..32415c8014 100644 --- a/test/Faker/Provider/ProviderOverrideTest.php +++ b/test/Faker/Provider/ProviderOverrideTest.php @@ -35,10 +35,10 @@ public function testAddress($locale = null): void { $faker = Faker\Factory::create($locale); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->city); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->postcode); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->address); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->country); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->city); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->postcode); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->address); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->country); } /** @@ -50,7 +50,7 @@ public function testCompany($locale = null): void { $faker = Faker\Factory::create($locale); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->company); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->company); } /** @@ -62,8 +62,8 @@ public function testDateTime($locale = null): void { $faker = Faker\Factory::create($locale); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->century); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->timezone); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->century); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->timezone); } /** @@ -75,12 +75,12 @@ public function testInternet($locale = null): void { $faker = Faker\Factory::create($locale); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->userName); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->userName); - self::assertMatchesRegularExpression(static::TEST_EMAIL_REGEX, $faker->email); - self::assertMatchesRegularExpression(static::TEST_EMAIL_REGEX, $faker->safeEmail); - self::assertMatchesRegularExpression(static::TEST_EMAIL_REGEX, $faker->freeEmail); - self::assertMatchesRegularExpression(static::TEST_EMAIL_REGEX, $faker->companyEmail); + self::assertMatchesRegularExpression(self::TEST_EMAIL_REGEX, $faker->email); + self::assertMatchesRegularExpression(self::TEST_EMAIL_REGEX, $faker->safeEmail); + self::assertMatchesRegularExpression(self::TEST_EMAIL_REGEX, $faker->freeEmail); + self::assertMatchesRegularExpression(self::TEST_EMAIL_REGEX, $faker->companyEmail); } /** @@ -92,10 +92,10 @@ public function testPerson($locale = null): void { $faker = Faker\Factory::create($locale); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->name); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->title); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->firstName); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->lastName); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->name); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->title); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->firstName); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->lastName); } /** @@ -107,7 +107,7 @@ public function testPhoneNumber($locale = null): void { $faker = Faker\Factory::create($locale); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->phoneNumber); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->phoneNumber); } /** @@ -119,7 +119,7 @@ public function testUserAgent($locale = null): void { $faker = Faker\Factory::create($locale); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->userAgent); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->userAgent); } /** @@ -132,6 +132,6 @@ public function testUuid($locale = null): void { $faker = Faker\Factory::create($locale); - self::assertMatchesRegularExpression(static::TEST_STRING_REGEX, $faker->uuid); + self::assertMatchesRegularExpression(self::TEST_STRING_REGEX, $faker->uuid); } } diff --git a/test/Faker/Provider/id_ID/PersonTest.php b/test/Faker/Provider/id_ID/PersonTest.php index 164c1ad29a..8a9e488c1c 100644 --- a/test/Faker/Provider/id_ID/PersonTest.php +++ b/test/Faker/Provider/id_ID/PersonTest.php @@ -77,7 +77,7 @@ public function testNikContainsBirthPlace(): void { $nik = $this->faker->nik(); - self::assertContains(substr($nik, 0, 4), static::$birthPlaceCode); + self::assertContains(substr($nik, 0, 4), self::$birthPlaceCode); } protected function getProviders(): iterable diff --git a/test/Faker/Provider/ro_RO/PersonTest.php b/test/Faker/Provider/ro_RO/PersonTest.php index 681b93a2d1..81368fc1f8 100644 --- a/test/Faker/Provider/ro_RO/PersonTest.php +++ b/test/Faker/Provider/ro_RO/PersonTest.php @@ -206,7 +206,7 @@ protected function isValidMaleCnp($value) protected function isValidCnp($cnp) { - if (preg_match(static::TEST_CNP_REGEX, $cnp) !== false) { + if (preg_match(self::TEST_CNP_REGEX, $cnp) !== false) { $checkNumber = 279146358279; $checksum = 0; From 1c6d0e0de619d4bda5d8c5c450954b5bff06bcb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Sep 2023 09:54:00 +0200 Subject: [PATCH 50/70] Fix: Cache for friendsofphp/php-cs-fixer (#729) --- .github/workflows/coding-standards.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coding-standards.yaml b/.github/workflows/coding-standards.yaml index d1534f606f..45055acb01 100644 --- a/.github/workflows/coding-standards.yaml +++ b/.github/workflows/coding-standards.yaml @@ -50,12 +50,11 @@ jobs: - name: "Cache cache file for php-cs-fixer" uses: "actions/cache@v3" with: - path: ".php_cs.cache" - key: "composer-${{ matrix.php-version }}-${{ github.ref_name }}" + path: ".build/php-cs-fixer/" + key: "php-cs-fixer-${{ matrix.php-version }}-${{ github.ref_name }}" restore-keys: | - composer-${{ matrix.php-version }}-main - composer-${{ matrix.php-version }} - composer- + php-cs-fixer-${{ matrix.php-version }}-main + php-cs-fixer-${{ matrix.php-version }}- - name: "Run php-cs-fixer" run: | From 4560966002f0e2c1a98e16b6f0d23f76b90d09ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Sep 2023 09:54:49 +0200 Subject: [PATCH 51/70] Fix: Add parameter type declarations (#724) --- roave-bc-check.yaml | 18 ++++++++++++++++++ src/Faker/Calculator/Ean.php | 6 ++---- src/Faker/Calculator/Iban.php | 14 ++++---------- src/Faker/Calculator/Luhn.php | 16 ++++------------ 4 files changed, 28 insertions(+), 26 deletions(-) diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml index 610c9e4e2f..9eb42b0e5b 100644 --- a/roave-bc-check.yaml +++ b/roave-bc-check.yaml @@ -5,12 +5,30 @@ parameters: - '#\[BC\] CHANGED: Property Faker\\Provider\\[a-z_A-Z]+\\[a-zA-Z]+::\$[1-9a-zA-Z]+ changed default value#' - '#\[BC\] CHANGED: Property Faker\\Provider\\[a-zA-Z]+::\$[1-9a-zA-Z]+ changed default value#' - '#\[BC\] CHANGED: The number of required arguments for Faker\\Container\\ContainerBuilder\#add\(\) increased from 1 to 2#' + - '#\[BC\] CHANGED: The parameter \$char of Faker\\Calculator\\Iban::alphaToNumber\(\) changed from no type to a non-contravariant string#' + - '#\[BC\] CHANGED: The parameter \$char of Faker\\Calculator\\Iban::alphaToNumber\(\) changed from no type to string#' - '#\[BC\] CHANGED: The parameter \$container of Faker\\Generator\#\_\_construct\(\) changed from Psr\\Container\\ContainerInterface\|null to a non-contravariant Faker\\Container\\ContainerInterface\|null#' - '#\[BC\] CHANGED: The parameter \$container of Faker\\Generator\#\_\_construct\(\) changed from Psr\\Container\\ContainerInterface\|null to Faker\\Container\\ContainerInterface\|null#' + - '#\[BC\] CHANGED: The parameter \$digits of Faker\\Calculator\\Ean::checksum\(\) changed from no type to a non-contravariant string#' + - '#\[BC\] CHANGED: The parameter \$digits of Faker\\Calculator\\Ean::checksum\(\) changed from no type to string#' + - '#\[BC\] CHANGED: The parameter \$ean of Faker\\Calculator\\Ean::isValid\(\) changed from no type to a non-contravariant string#' + - '#\[BC\] CHANGED: The parameter \$ean of Faker\\Calculator\\Ean::isValid\(\) changed from no type to string#' - '#\[BC\] CHANGED: The parameter \$generator of Faker\\UniqueGenerator\#\_\_construct\(\) changed from Faker\\Generator to no type#' - '#\[BC\] CHANGED: The parameter \$generator of Faker\\ValidGenerator\#\_\_construct\(\) changed from Faker\\Generator to no type#' + - '#\[BC\] CHANGED: The parameter \$iban of Faker\\Calculator\\Iban::checksum\(\) changed from no type to a non-contravariant string#' + - '#\[BC\] CHANGED: The parameter \$iban of Faker\\Calculator\\Iban::checksum\(\) changed from no type to string#' + - '#\[BC\] CHANGED: The parameter \$iban of Faker\\Calculator\\Iban::isValid\(\) changed from no type to a non-contravariant string#' + - '#\[BC\] CHANGED: The parameter \$iban of Faker\\Calculator\\Iban::isValid\(\) changed from no type to string#' - '#\[BC\] CHANGED: The parameter \$max of Faker\\Extension\\NumberExtension\#randomFloat\(\) changed from float to float\|null#' - '#\[BC\] CHANGED: The parameter \$name of Faker\\Container\\ContainerBuilder\#add\(\) changed from string\|null to a non-contravariant string#' + - '#\[BC\] CHANGED: The parameter \$number of Faker\\Calculator\\Iban::mod97\(\) changed from no type to a non-contravariant string#' + - '#\[BC\] CHANGED: The parameter \$number of Faker\\Calculator\\Iban::mod97\(\) changed from no type to string#' + - '#\[BC\] CHANGED: The parameter \$number of Faker\\Calculator\\Luhn::isValid\(\) changed from no type to a non-contravariant string#' + - '#\[BC\] CHANGED: The parameter \$number of Faker\\Calculator\\Luhn::isValid\(\) changed from no type to string#' + - '#\[BC\] CHANGED: The parameter \$partialNumber of Faker\\Calculator\\Luhn::computeCheckDigit\(\) changed from no type to a non-contravariant string#' + - '#\[BC\] CHANGED: The parameter \$partialNumber of Faker\\Calculator\\Luhn::computeCheckDigit\(\) changed from no type to string#' + - '#\[BC\] CHANGED: The parameter \$partialValue of Faker\\Calculator\\Luhn::generateLuhnNumber\(\) changed from no type to a non-contravariant string#' + - '#\[BC\] CHANGED: The parameter \$partialValue of Faker\\Calculator\\Luhn::generateLuhnNumber\(\) changed from no type to string#' - '#\[BC\] CHANGED: The parameter \$value of Faker\\Container\\ContainerBuilder\#add\(\) changed from no type to a non-contravariant string#' - '#\[BC\] CHANGED: The return type of Faker\\Extension\\PersonExtension\#name\(\) changed from no type to string#' - '#\[BC\] CHANGED: Type documentation for property Faker\\Provider\\en_ZA\\Internet::\$tld changed from having no type to array#' diff --git a/src/Faker/Calculator/Ean.php b/src/Faker/Calculator/Ean.php index 9c3daf1757..fbf11fcdad 100644 --- a/src/Faker/Calculator/Ean.php +++ b/src/Faker/Calculator/Ean.php @@ -17,11 +17,9 @@ class Ean * * @see https://en.wikipedia.org/wiki/International_Article_Number * - * @param string $digits - * * @return int */ - public static function checksum($digits) + public static function checksum(string $digits) { $sequence = (strlen($digits) + 1) === 8 ? [3, 1] : [1, 3]; $sums = 0; @@ -41,7 +39,7 @@ public static function checksum($digits) * * @return bool */ - public static function isValid($ean) + public static function isValid(string $ean) { if (!preg_match(self::PATTERN, $ean)) { return false; diff --git a/src/Faker/Calculator/Iban.php b/src/Faker/Calculator/Iban.php index b00b18f010..19068fd775 100644 --- a/src/Faker/Calculator/Iban.php +++ b/src/Faker/Calculator/Iban.php @@ -7,11 +7,9 @@ class Iban /** * Generates IBAN Checksum * - * @param string $iban - * * @return string Checksum (numeric string) */ - public static function checksum($iban) + public static function checksum(string $iban) { // Move first four digits to end and set checksum to '00' $checkString = substr($iban, 4) . substr($iban, 0, 2) . '00'; @@ -34,11 +32,9 @@ static function (array $matches): string { /** * Converts letter to number * - * @param string $char - * * @return int */ - public static function alphaToNumber($char) + public static function alphaToNumber(string $char) { return ord($char) - 55; } @@ -50,7 +46,7 @@ public static function alphaToNumber($char) * * @return int */ - public static function mod97($number) + public static function mod97(string $number) { $checksum = (int) $number[0]; @@ -64,11 +60,9 @@ public static function mod97($number) /** * Checks whether an IBAN has a valid checksum * - * @param string $iban - * * @return bool */ - public static function isValid($iban) + public static function isValid(string $iban) { return self::checksum($iban) === substr($iban, 2, 2); } diff --git a/src/Faker/Calculator/Luhn.php b/src/Faker/Calculator/Luhn.php index 0327668e53..4c1e6f5054 100644 --- a/src/Faker/Calculator/Luhn.php +++ b/src/Faker/Calculator/Luhn.php @@ -13,11 +13,9 @@ class Luhn { /** - * @param string $number - * * @return int */ - private static function checksum($number) + private static function checksum(string $number) { $number = (string) $number; $length = strlen($number); @@ -35,11 +33,9 @@ private static function checksum($number) } /** - * @param string $partialNumber - * * @return string */ - public static function computeCheckDigit($partialNumber) + public static function computeCheckDigit(string $partialNumber) { $checkDigit = self::checksum($partialNumber . '0'); @@ -53,11 +49,9 @@ public static function computeCheckDigit($partialNumber) /** * Checks whether a number (partial number + check digit) is Luhn compliant * - * @param string $number - * * @return bool */ - public static function isValid($number) + public static function isValid(string $number) { return self::checksum($number) === 0; } @@ -65,11 +59,9 @@ public static function isValid($number) /** * Generate a Luhn compliant number. * - * @param string $partialValue - * * @return string */ - public static function generateLuhnNumber($partialValue) + public static function generateLuhnNumber(string $partialValue) { if (!preg_match('/^\d+$/', $partialValue)) { throw new \InvalidArgumentException('Argument should be an integer.'); From 75318aa85940eda39f5672fe9460115f7ee30d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Sep 2023 09:55:44 +0200 Subject: [PATCH 52/70] Fix: Add tests for Container (#727) --- test/Faker/Extension/ContainerTest.php | 56 +++++++++++++++++++ .../Container/UnconstructableClass.php | 15 +++++ 2 files changed, 71 insertions(+) create mode 100644 test/Fixture/Container/UnconstructableClass.php diff --git a/test/Faker/Extension/ContainerTest.php b/test/Faker/Extension/ContainerTest.php index a4ed7b233f..3a6932905b 100644 --- a/test/Faker/Extension/ContainerTest.php +++ b/test/Faker/Extension/ContainerTest.php @@ -5,8 +5,10 @@ namespace Faker\Test\Extension; use Faker\Container\Container; +use Faker\Container\ContainerException; use Faker\Core\File; use Faker\Extension\Extension; +use Faker\Test; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; @@ -16,6 +18,15 @@ */ final class ContainerTest extends TestCase { + public function testHasThrowsInvalidArgumentExceptionWhenIdentifierIsNotAString(): void + { + $container = new Container([]); + + $this->expectException(\InvalidArgumentException::class); + + $container->has(false); + } + public function testHasReturnsFalseWhenContainerDoesNotHaveDefinitionForService(): void { $container = new Container([]); @@ -23,6 +34,15 @@ public function testHasReturnsFalseWhenContainerDoesNotHaveDefinitionForService( self::assertFalse($container->has('foo')); } + public function testGetThrowsInvalidArgumentExceptionWhenIdentifierIsNotAString(): void + { + $container = new Container([]); + + $this->expectException(\InvalidArgumentException::class); + + $container->get(false); + } + public function testGetThrowsNotFoundExceptionWhenContainerDoesNotHaveDefinitionForService(): void { $container = new Container([]); @@ -43,6 +63,42 @@ public function testGetFromString(): void self::assertInstanceOf(File::class, $object); } + public function testGetThrowsRuntimeExceptionWhenServiceCouldNotBeResolvedFromCallable(): void + { + $id = 'foo'; + + $container = new Container([ + $id => static function (): void { + throw new \RuntimeException(); + }, + ]); + + $this->expectException(ContainerException::class); + $this->expectExceptionMessage(sprintf( + 'Error while invoking callable for "%s"', + $id, + )); + + $container->get($id); + } + + public function testGetThrowsRuntimeExceptionWhenServiceCouldNotBeResolvedFromClass(): void + { + $id = 'foo'; + + $container = new Container([ + $id => Test\Fixture\Container\UnconstructableClass::class, + ]); + + $this->expectException(ContainerException::class); + $this->expectExceptionMessage(sprintf( + 'Could not instantiate class "%s"', + $id, + )); + + $container->get($id); + } + /** * @dataProvider provideDefinitionThatDoesNotResolveToExtension */ diff --git a/test/Fixture/Container/UnconstructableClass.php b/test/Fixture/Container/UnconstructableClass.php new file mode 100644 index 0000000000..6fcb403b11 --- /dev/null +++ b/test/Fixture/Container/UnconstructableClass.php @@ -0,0 +1,15 @@ + Date: Tue, 5 Sep 2023 09:58:35 +0200 Subject: [PATCH 53/70] Fix: Simplify (#720) --- src/Faker/Container/ContainerBuilder.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Faker/Container/ContainerBuilder.php b/src/Faker/Container/ContainerBuilder.php index 8b2223d522..bc3b17a06a 100644 --- a/src/Faker/Container/ContainerBuilder.php +++ b/src/Faker/Container/ContainerBuilder.php @@ -61,12 +61,6 @@ public static function defaultExtensions(): array public static function getDefault(): ContainerInterface { - $instance = new self(); - - foreach (self::defaultExtensions() as $id => $definition) { - $instance->add($id, $definition); - } - - return $instance->build(); + return new Container(self::defaultExtensions()); } } From 6acdd53b907feef1becace0f8558f68ce2d5862d Mon Sep 17 00:00:00 2001 From: scybulski Date: Tue, 5 Sep 2023 13:57:31 +0200 Subject: [PATCH 54/70] updated polish license plates (#685) --- src/Faker/Provider/pl_PL/LicensePlate.php | 103 +++++++++--------- .../Faker/Provider/pl_PL/LicensePlateTest.php | 8 +- 2 files changed, 57 insertions(+), 54 deletions(-) diff --git a/src/Faker/Provider/pl_PL/LicensePlate.php b/src/Faker/Provider/pl_PL/LicensePlate.php index d59c93dec4..59e100eb4c 100644 --- a/src/Faker/Provider/pl_PL/LicensePlate.php +++ b/src/Faker/Provider/pl_PL/LicensePlate.php @@ -6,7 +6,7 @@ /** * Generator of Polish vehicle registration numbers. - * {@link} http://prawo.sejm.gov.pl/isap.nsf/DocDetails.xsp?id=WDU20170002355 + * {@link} https://isap.sejm.gov.pl/isap.nsf/DocDetails.xsp?id=WDU20220001847 * {@link} https://pl.wikipedia.org/wiki/Tablice_rejestracyjne_w_Polsce#Tablice_standardowe */ class LicensePlate extends Base @@ -15,37 +15,37 @@ class LicensePlate extends Base * @var array list of Polish voivodeships and respective vehicle registration number prefixes. */ protected static $voivodeships = [ - 'dolnośląskie' => 'D', - 'kujawsko-pomorskie' => 'C', - 'lubelskie' => 'L', - 'lubuskie' => 'F', - 'łódzkie' => 'E', - 'małopolskie' => 'K', - 'mazowieckie' => 'W', - 'opolskie' => 'O', - 'podkarpackie' => 'R', - 'podlaskie' => 'B', - 'pomorskie' => 'G', - 'śląskie' => 'S', - 'świętokrzyskie' => 'T', - 'warmińsko-mazurskie' => 'N', - 'wielkopolskie' => 'P', - 'zachodniopomorskie' => 'Z', + 'dolnośląskie' => ['D', 'V'], + 'kujawsko-pomorskie' => ['C'], + 'lubelskie' => ['L'], + 'lubuskie' => ['F'], + 'łódzkie' => ['E'], + 'małopolskie' => ['K', 'J'], + 'mazowieckie' => ['W', 'A'], + 'opolskie' => ['O'], + 'podkarpackie' => ['R', 'Y'], + 'podlaskie' => ['B'], + 'pomorskie' => ['G', 'X'], + 'śląskie' => ['S', 'I'], + 'świętokrzyskie' => ['T'], + 'warmińsko-mazurskie' => ['N'], + 'wielkopolskie' => ['P', 'M'], + 'zachodniopomorskie' => ['Z'], ]; /** * @var array list of special vehicle registration number prefixes. */ protected static $specials = [ - 'army' => 'U', - 'services' => 'H', + 'army' => ['U'], + 'services' => ['H'], ]; /** * @var array list of Polish counties and respective vehicle registration number prefixes. */ protected static $counties = [ - 'D' => [ + 'dolnośląskie' => [ 'Jelenia Góra' => ['J'], 'Legnica' => ['L'], 'Wałbrzych' => ['B'], @@ -77,7 +77,7 @@ class LicensePlate extends Base 'zgorzelecki' => ['ZG'], 'złotoryjski' => ['ZL'], ], - 'C' => [ + 'kujawsko-pomorskie' => [ 'Bydgoszcz' => ['B'], 'Grudziądz' => ['G'], 'Toruń' => ['T'], @@ -102,7 +102,7 @@ class LicensePlate extends Base 'włocławski' => ['WL'], 'żniński' => ['ZN'], ], - 'L' => [ + 'lubelskie' => [ 'Biała Podlaska' => ['B'], 'Chełm' => ['C'], 'Lublin' => ['U'], @@ -128,7 +128,7 @@ class LicensePlate extends Base 'włodawski' => ['WL'], 'zamojski' => ['ZA'], ], - 'F' => [ + 'lubuskie' => [ 'Gorzów Wielkopolski' => ['G'], 'Zielona Góra' => ['Z'], 'gorzowski' => ['GW'], @@ -144,8 +144,8 @@ class LicensePlate extends Base 'żagański' => ['ZG'], 'żarski' => ['ZA'], ], - 'E' => [ - 'Łódź' => ['L'], + 'łódzkie' => [ + 'Łódź' => ['L', 'D'], 'Piotrków Trybunalski' => ['P'], 'Skierniewice' => ['S'], 'brzeziński' => ['BR'], @@ -170,8 +170,8 @@ class LicensePlate extends Base 'zduńskowolski' => ['ZD'], 'zgierski' => ['ZG'], ], - 'K' => [ - 'Kraków' => ['R'], + 'małopolskie' => [ + 'Kraków' => ['R', 'K'], 'Nowy Sącz' => ['N'], 'Tarnów' => ['T'], 'bocheński' => ['BA', 'BC'], @@ -179,7 +179,7 @@ class LicensePlate extends Base 'chrzanowski' => ['CH'], 'dąbrowski' => ['DA'], 'gorlicki' => ['GR'], - 'krakowski' => ['RA'], + 'krakowski' => ['RA', 'RK'], 'limanowski' => ['LI'], 'miechowski' => ['MI'], 'myślenicki' => ['MY'], @@ -194,7 +194,7 @@ class LicensePlate extends Base 'wadowicki' => ['WA'], 'wielicki' => ['WI'], ], - 'W' => [ + 'mazowieckie' => [ 'Ostrołęka' => ['O'], 'Płock' => ['P'], 'Radom' => ['R'], @@ -216,7 +216,7 @@ class LicensePlate extends Base 'ostrołęcki' => ['OS'], 'ostrowski' => ['OR'], 'otwocki' => ['OT'], - 'piaseczyński' => ['PA', 'PI'], + 'piaseczyński' => ['PA', 'PI', 'PW', 'PX'], 'płocki' => ['PL'], 'płoński' => ['PN'], 'pruszkowski' => ['PP', 'PR', 'PS'], @@ -238,7 +238,7 @@ class LicensePlate extends Base 'żuromiński' => ['ZU'], 'żyrardowski' => ['ZY'], ], - 'O' => [ + 'opolskie' => [ 'Opole' => ['P'], 'brzeski' => ['B'], 'głubczycki' => ['GL'], @@ -252,7 +252,7 @@ class LicensePlate extends Base 'prudnicki' => ['PR'], 'strzelecki' => ['ST'], ], - 'R' => [ + 'podkarpackie' => [ 'Krosno' => ['K'], 'Przemyśl' => ['P'], 'Rzeszów' => ['Z'], @@ -273,18 +273,18 @@ class LicensePlate extends Base 'przemyski' => ['PR'], 'przeworski' => ['PZ'], 'ropczycko-sędziszowski' => ['RS'], - 'rzeszowski' => ['ZE'], + 'rzeszowski' => ['ZE', 'ZR', 'ZZ'], 'sanocki' => ['SA'], 'stalowowolski' => ['ST'], 'strzyżowski' => ['SR'], 'tarnobrzeski' => ['TA'], ], - 'B' => [ + 'podlaskie' => [ 'Białystok' => ['I'], 'Łomża' => ['L'], 'Suwałki' => ['S'], 'augustowski' => ['AU'], - 'białostocki' => ['IA'], + 'białostocki' => ['IA', 'IB'], 'bielski' => ['BI'], 'grajewski' => ['GR'], 'hajnowski' => ['HA'], @@ -298,7 +298,7 @@ class LicensePlate extends Base 'wysokomazowiecki' => ['WM'], 'zambrowski' => ['ZA'], ], - 'G' => [ + 'pomorskie' => [ 'Gdańsk' => ['D'], 'Gdynia' => ['A'], 'Słupsk' => ['S'], @@ -307,7 +307,7 @@ class LicensePlate extends Base 'chojnicki' => ['CH'], 'człuchowski' => ['CZ'], 'gdański' => ['DA'], - 'kartuski' => ['KY', 'KA'], + 'kartuski' => ['KA', 'KY', 'KZ'], 'kościerski' => ['KS'], 'kwidzyński' => ['KW'], 'lęborski' => ['LE'], @@ -320,7 +320,7 @@ class LicensePlate extends Base 'tczewski' => ['TC'], 'wejherowski' => ['WE', 'WO'], ], - 'S' => [ + 'śląskie' => [ 'Bielsko-Biała' => ['B'], 'Bytom' => ['Y'], 'Chorzów' => ['H'], @@ -340,9 +340,9 @@ class LicensePlate extends Base 'Tychy' => ['T'], 'Zabrze' => ['Z'], 'Żory' => ['ZO'], - 'będziński' => ['BE'], + 'będziński' => ['BE', 'BN', 'E'], 'bielski' => ['BI'], - 'cieszyński' => ['CN', 'CI'], + 'cieszyński' => ['CI', 'CN'], 'częstochowski' => ['CZ'], 'gliwicki' => ['GL'], 'kłobucki' => ['KL'], @@ -358,7 +358,7 @@ class LicensePlate extends Base 'zawierciański' => ['ZA'], 'żywiecki' => ['ZY'], ], - 'T' => [ + 'świętokrzyskie' => [ 'Kielce' => ['K'], 'buski' => ['BU'], 'jędrzejowski' => ['JE'], @@ -374,7 +374,7 @@ class LicensePlate extends Base 'staszowski' => ['SZ'], 'włoszczowski' => ['LW'], ], - 'N' => [ + 'warmińsko-mazurskie' => [ 'Elbląg' => ['E'], 'Olsztyn' => ['O'], 'bartoszycki' => ['BA'], @@ -397,7 +397,7 @@ class LicensePlate extends Base 'szczycieński' => ['SZ'], 'węgorzewski' => ['WE'], ], - 'P' => [ + 'wielkopolskie' => [ 'Kalisz' => ['A', 'K'], 'Konin' => ['KO', 'N'], 'Leszno' => ['L'], @@ -434,7 +434,7 @@ class LicensePlate extends Base 'wrzesiński' => ['WR'], 'złotowski' => ['ZL'], ], - 'Z' => [ + 'zachodniopomorskie' => [ 'Koszalin' => ['K'], 'Szczecin' => ['S', 'Z'], 'Świnoujście' => ['SW'], @@ -457,10 +457,10 @@ class LicensePlate extends Base 'świdwiński' => ['SD'], 'wałecki' => ['WA'], ], - 'U' => [ + 'army' => [ 'Siły Zbrojne Rzeczypospolitej Polskiej' => ['A', 'B', 'C', 'D', 'E', 'G', 'I', 'J', 'K', 'L'], ], - 'H' => [ + 'services' => [ 'Centralne Biuro Antykorupcyjne' => ['A'], 'Służba Ochrony Państwa' => ['BA', 'BB', 'BE', 'BF', 'BG'], 'Służba Celno-Skarbowa' => ['CA', 'CB', 'CC', 'CD', 'CE', 'CF', 'CG', 'CH', 'CJ', 'CK', 'CL', 'CM', 'CN', 'CO', 'CP', 'CR'], @@ -514,12 +514,13 @@ public static function licensePlate( ?array $counties = null ): string { $voivodeshipsAvailable = static::$voivodeships + ($special ? static::$specials : []); - $voivodeshipCode = static::selectRandomArea($voivodeshipsAvailable, $voivodeships); + $voivodeshipSelected = static::selectRandomArea($voivodeshipsAvailable, $voivodeships); + $voivodeshipCode = static::randomElement($voivodeshipsAvailable[$voivodeshipSelected]); - $countiesAvailable = static::$counties[$voivodeshipCode]; + $countiesAvailable = static::$counties[$voivodeshipSelected]; $countySelected = self::selectRandomArea($countiesAvailable, $counties); - $countyCode = static::randomElement($countySelected); + $countyCode = static::randomElement(static::$counties[$voivodeshipSelected][$countySelected]); $suffix = static::regexify(static::randomElement(strlen($countyCode) === 1 ? static::$plateSuffixesGroup1 : static::$plateSuffixesGroup2)); @@ -528,6 +529,8 @@ public static function licensePlate( /** * Selects random area from the list of available and requested. + * + * @return string */ protected static function selectRandomArea(array $available, ?array $requested) { @@ -537,6 +540,6 @@ protected static function selectRandomArea(array $available, ?array $requested) $requested = array_keys($available); } - return $available[static::randomElement($requested)]; + return static::randomElement($requested); } } diff --git a/test/Faker/Provider/pl_PL/LicensePlateTest.php b/test/Faker/Provider/pl_PL/LicensePlateTest.php index 8abe4d4c7a..cecbfc16fa 100644 --- a/test/Faker/Provider/pl_PL/LicensePlateTest.php +++ b/test/Faker/Provider/pl_PL/LicensePlateTest.php @@ -64,7 +64,7 @@ public function testPodkarpackieLicensePlate(): void ); self::assertNotEmpty($licensePlate); self::assertIsString($licensePlate); - self::assertMatchesRegularExpression('/^(?:R[A-PR-Z] [A-PR-Z\d]{5}|R[A-PR-Z]{2} [A-PR-Z\d]{4,5})$/', $licensePlate); + self::assertMatchesRegularExpression('/^(?:[RY][A-PR-Z] [A-PR-Z\d]{5}|[RY][A-PR-Z]{2} [A-PR-Z\d]{4,5})$/', $licensePlate); } } @@ -162,7 +162,7 @@ public function testVoivodeshipCountyLicensePlate(): void ); self::assertNotEmpty($licensePlate); self::assertIsString($licensePlate); - self::assertMatchesRegularExpression('/^(?:WZ [A-PR-Z\d]{5}|(?:WRA|HWA|HWK) [A-PR-Z\d]{4,5})$/', $licensePlate); + self::assertMatchesRegularExpression('/^(?:[AW]Z [A-PR-Z\d]{5}|(?:[AW]RA|HWA|HWK) [A-PR-Z\d]{4,5})$/', $licensePlate); } } @@ -179,7 +179,7 @@ public function testVoivodeshipFakeCountyLicensePlate(): void ); self::assertNotEmpty($licensePlate); self::assertIsString($licensePlate); - self::assertMatchesRegularExpression('/^(?:[WH][A-PR-Z] [A-PR-Z\d]{5}|[WH][A-PR-Z]{2} [A-PR-Z\d]{4,5})$/', $licensePlate); + self::assertMatchesRegularExpression('/^(?:[AWH][A-PR-Z] [A-PR-Z\d]{5}|[AWH][A-PR-Z]{2} [A-PR-Z\d]{4,5})$/', $licensePlate); } } @@ -247,7 +247,7 @@ public function testVoivodeship1stArgumentFalse(): void ); self::assertNotEmpty($licensePlate); self::assertIsString($licensePlate); - self::assertMatchesRegularExpression('/^(?:W[A-PR-Z] [A-PR-Z\d]{5}|W[A-PR-Z]{2} [A-PR-Z\d]{4,5})$/', $licensePlate); + self::assertMatchesRegularExpression('/^(?:[AW][A-PR-Z] [A-PR-Z\d]{5}|[AW][A-PR-Z]{2} [A-PR-Z\d]{4,5})$/', $licensePlate); } } From 8836f79b80550e04ddabd9a452a789396b3cc88e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Sep 2023 15:53:11 +0200 Subject: [PATCH 55/70] Fix: Update CHANGELOG.md (#734) --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0900d4798e..8735e63d36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased](https://github.com/FakerPHP/Faker/compare/v1.23.0...main) +- Fixed polish license plates (#685) + ## [2023-06-12, v1.23.0](https://github.com/FakerPHP/Faker/compare/v1.22.0..v1.23.0) - Update `randomElements` to return random number of elements when no count is provided (#658) From 976c9df676ac50a3cc4f3930d34094770292b099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Sep 2023 15:55:17 +0200 Subject: [PATCH 56/70] Fix: Avoid useless tests for ContainerBuilder (#730) --- test/Faker/Extension/ContainerBuilderTest.php | 64 +++++++++++++------ 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/test/Faker/Extension/ContainerBuilderTest.php b/test/Faker/Extension/ContainerBuilderTest.php index a86d81cde7..c5694aa69c 100644 --- a/test/Faker/Extension/ContainerBuilderTest.php +++ b/test/Faker/Extension/ContainerBuilderTest.php @@ -5,8 +5,9 @@ namespace Faker\Test\Extension; use Faker\Container\ContainerBuilder; -use Faker\Container\ContainerInterface; use Faker\Core\File; +use Faker\Core\Number; +use Faker\Extension; use PHPUnit\Framework\TestCase; /** @@ -58,66 +59,89 @@ public function provideInvalidValue(): \Generator } } - public function testBuildEmpty(): void + public function testBuildReturnsContainerWhenContainerBuilderDoesNotHaveDefinitions(): void { $builder = new ContainerBuilder(); $container = $builder->build(); - self::assertInstanceOf(ContainerInterface::class, $container); + self::assertFalse($container->has('foo')); } - public function testBuild(): void + public function testBuildReturnsContainerWhenContainerBuilderHasDefinitions(): void { + $id = 'foo'; + $definition = File::class; + $builder = new ContainerBuilder(); - $builder->add('foo', File::class); + $builder->add($id, $definition); $container = $builder->build(); - self::assertInstanceOf(ContainerInterface::class, $container); + self::assertTrue($container->has($id)); + self::assertInstanceOf($definition, $container->get($id)); } - public function testBuildWithDuplicates(): void + public function testBuildReturnsContainerWhenContainerBuilderHasOverriddenDefinitions(): void { + $id = 'foo'; + $definition = Number::class; + $builder = new ContainerBuilder(); - $builder->add('foo', File::class); - $builder->add('foo', File::class); + $builder->add($id, File::class); + $builder->add($id, $definition); $container = $builder->build(); - self::assertInstanceOf(ContainerInterface::class, $container); + self::assertTrue($container->has($id)); + self::assertInstanceOf($definition, $container->get($id)); } - public function testBuildWithObject(): void + public function testBuildReturnsContainerWhenContainerBuilderHasObjectAsDefinition(): void { + $id = 'foo'; + $definition = new File(); + $builder = new ContainerBuilder(); - $builder->add('foo', new File()); + $builder->add($id, $definition); $container = $builder->build(); - self::assertInstanceOf(ContainerInterface::class, $container); + self::assertTrue($container->has($id)); + self::assertSame($definition, $container->get($id)); } - public function testBuildWithCallable(): void + public function testBuildReturnsContainerWhenContainerBuilderHasCallableAsDefinition(): void { + $id = 'foo'; + $definition = static function (): File { + return new File(); + }; + $builder = new ContainerBuilder(); - $builder->add('foo', static function () { - return new File(); - }); + $builder->add($id, $definition); $container = $builder->build(); - self::assertInstanceOf(ContainerInterface::class, $container); + self::assertTrue($container->has($id)); + self::assertEquals($definition(), $container->get($id)); } - public function testBuildDefault(): void + public function testGetDefaultReturnsContainerWithDefaultExtensions(): void { $container = ContainerBuilder::getDefault(); - self::assertInstanceOf(ContainerInterface::class, $container); + self::assertTrue($container->has(Extension\BarcodeExtension::class)); + self::assertTrue($container->has(Extension\BloodExtension::class)); + self::assertTrue($container->has(Extension\ColorExtension::class)); + self::assertTrue($container->has(Extension\DateTimeExtension::class)); + self::assertTrue($container->has(Extension\FileExtension::class)); + self::assertTrue($container->has(Extension\NumberExtension::class)); + self::assertTrue($container->has(Extension\UuidExtension::class)); + self::assertTrue($container->has(Extension\VersionExtension::class)); } } From 81dcd6fffb0872a1e92f47d063f446da47b791c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Sep 2023 15:55:46 +0200 Subject: [PATCH 57/70] Fix: Rename parameter (#731) --- src/Faker/Container/ContainerBuilder.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Faker/Container/ContainerBuilder.php b/src/Faker/Container/ContainerBuilder.php index bc3b17a06a..b500f323f9 100644 --- a/src/Faker/Container/ContainerBuilder.php +++ b/src/Faker/Container/ContainerBuilder.php @@ -18,20 +18,20 @@ final class ContainerBuilder private array $definitions = []; /** - * @param callable|object|string $value + * @param callable|object|string $definition * * @throws \InvalidArgumentException */ - public function add(string $id, $value): self + public function add(string $id, $definition): self { - if (!is_string($value) && !is_callable($value) && !is_object($value)) { + if (!is_string($definition) && !is_callable($definition) && !is_object($definition)) { throw new \InvalidArgumentException(sprintf( 'First argument to "%s::add()" must be a string, callable or object.', self::class, )); } - $this->definitions[$id] = $value; + $this->definitions[$id] = $definition; return $this; } From 5e64137248b986874a35b8838e7cf8ed0d9fd532 Mon Sep 17 00:00:00 2001 From: Bram Date: Tue, 5 Sep 2023 15:42:09 +0100 Subject: [PATCH 58/70] Add changelog mention in review checklist (#735) --- .github/PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c2297d8890..a87db47af4 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -17,4 +17,5 @@ ### Review checklist - [ ] All checks have passed +- [ ] Changes are added to the `CHANGELOG.md` - [ ] Changes are approved by maintainer From bf42220e7605e740f3ccc49e1805319c5c59cee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Sep 2023 16:42:30 +0200 Subject: [PATCH 59/70] Enhancement: Allow creating ContainerBuilder with definitions for default extensions (#732) --- src/Faker/Container/ContainerBuilder.php | 13 ++++++++++++- src/Faker/Generator.php | 2 +- test/Faker/Extension/ContainerBuilderTest.php | 6 ++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Faker/Container/ContainerBuilder.php b/src/Faker/Container/ContainerBuilder.php index b500f323f9..447af2e99e 100644 --- a/src/Faker/Container/ContainerBuilder.php +++ b/src/Faker/Container/ContainerBuilder.php @@ -59,8 +59,19 @@ public static function defaultExtensions(): array ]; } + public static function withDefaultExtensions(): self + { + $instance = new self(); + + foreach (self::defaultExtensions() as $id => $definition) { + $instance->add($id, $definition); + } + + return $instance; + } + public static function getDefault(): ContainerInterface { - return new Container(self::defaultExtensions()); + return self::withDefaultExtensions()->build(); } } diff --git a/src/Faker/Generator.php b/src/Faker/Generator.php index 225e8e5313..ee58be35f4 100644 --- a/src/Faker/Generator.php +++ b/src/Faker/Generator.php @@ -567,7 +567,7 @@ class Generator public function __construct(ContainerInterface $container = null) { - $this->container = $container ?: Container\ContainerBuilder::getDefault(); + $this->container = $container ?: Container\ContainerBuilder::withDefaultExtensions()->build(); } /** diff --git a/test/Faker/Extension/ContainerBuilderTest.php b/test/Faker/Extension/ContainerBuilderTest.php index c5694aa69c..b6b9a22600 100644 --- a/test/Faker/Extension/ContainerBuilderTest.php +++ b/test/Faker/Extension/ContainerBuilderTest.php @@ -131,9 +131,11 @@ public function testBuildReturnsContainerWhenContainerBuilderHasCallableAsDefini self::assertEquals($definition(), $container->get($id)); } - public function testGetDefaultReturnsContainerWithDefaultExtensions(): void + public function testWithDefaultExtensionsReturnsContainerBuilderWithDefaultExtensions(): void { - $container = ContainerBuilder::getDefault(); + $builder = ContainerBuilder::withDefaultExtensions(); + + $container = $builder->build(); self::assertTrue($container->has(Extension\BarcodeExtension::class)); self::assertTrue($container->has(Extension\BloodExtension::class)); From 0f704c84792b1c57243dad7b0e5feaaf31600ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Sep 2023 19:46:02 +0200 Subject: [PATCH 60/70] Fix: Reduce visibility (#719) --- roave-bc-check.yaml | 2 ++ src/Faker/Container/ContainerBuilder.php | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml index 9eb42b0e5b..f7e2d1409d 100644 --- a/roave-bc-check.yaml +++ b/roave-bc-check.yaml @@ -1,6 +1,7 @@ parameters: ignoreErrors: - '#\[BC\] CHANGED: Class Faker\\Core\\Coordinates became final#' + - '#\[BC\] CHANGED: Method defaultExtensions\(\) of class Faker\\Container\\ContainerBuilder visibility reduced from public to private#' - '#\[BC\] CHANGED: Property Faker\\Factory::\$defaultProviders changed default value#' - '#\[BC\] CHANGED: Property Faker\\Provider\\[a-z_A-Z]+\\[a-zA-Z]+::\$[1-9a-zA-Z]+ changed default value#' - '#\[BC\] CHANGED: Property Faker\\Provider\\[a-zA-Z]+::\$[1-9a-zA-Z]+ changed default value#' @@ -37,6 +38,7 @@ parameters: - '#\[BC\] REMOVED: Class Faker\\Extension\\ContainerException has been deleted#' - '#\[BC\] REMOVED: Class Faker\\Extension\\NotInContainerException has been deleted#' - '#\[BC\] REMOVED: Method Faker\\Container\\Container\#getDefinitions\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Container\\ContainerBuilder\::defaultExtensions\(\) was removed#' - '#\[BC\] REMOVED: Method Faker\\Container\\ContainerInterface\#getDefinitions\(\) was removed#' - '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#getDefaultTimezone\(\) was removed#' - '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#getTimestamp\(\) was removed#' diff --git a/src/Faker/Container/ContainerBuilder.php b/src/Faker/Container/ContainerBuilder.php index 447af2e99e..d6f210799a 100644 --- a/src/Faker/Container/ContainerBuilder.php +++ b/src/Faker/Container/ContainerBuilder.php @@ -41,11 +41,7 @@ public function build(): ContainerInterface return new Container($this->definitions); } - /** - * Get an array with extension that represent the default English - * functionality. - */ - public static function defaultExtensions(): array + private static function defaultExtensions(): array { return [ Extension\BarcodeExtension::class => Core\Barcode::class, From 342bad9f1314084920b685ca4679f2104a853e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Sep 2023 20:13:44 +0200 Subject: [PATCH 61/70] Fix: Remove unused method (#736) --- roave-bc-check.yaml | 1 + src/Faker/Container/ContainerBuilder.php | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml index f7e2d1409d..b3ff163801 100644 --- a/roave-bc-check.yaml +++ b/roave-bc-check.yaml @@ -38,6 +38,7 @@ parameters: - '#\[BC\] REMOVED: Class Faker\\Extension\\ContainerException has been deleted#' - '#\[BC\] REMOVED: Class Faker\\Extension\\NotInContainerException has been deleted#' - '#\[BC\] REMOVED: Method Faker\\Container\\Container\#getDefinitions\(\) was removed#' + - '#\[BC\] REMOVED: Method Faker\\Container\\ContainerBuilder::getDefault\(\) was removed#' - '#\[BC\] REMOVED: Method Faker\\Container\\ContainerBuilder\::defaultExtensions\(\) was removed#' - '#\[BC\] REMOVED: Method Faker\\Container\\ContainerInterface\#getDefinitions\(\) was removed#' - '#\[BC\] REMOVED: Method Faker\\Core\\DateTime\#getDefaultTimezone\(\) was removed#' diff --git a/src/Faker/Container/ContainerBuilder.php b/src/Faker/Container/ContainerBuilder.php index d6f210799a..f2545e944b 100644 --- a/src/Faker/Container/ContainerBuilder.php +++ b/src/Faker/Container/ContainerBuilder.php @@ -65,9 +65,4 @@ public static function withDefaultExtensions(): self return $instance; } - - public static function getDefault(): ContainerInterface - { - return self::withDefaultExtensions()->build(); - } } From 2040bda6540c29e8989bce4729d05bdaffb4c729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 7 Sep 2023 14:17:07 +0200 Subject: [PATCH 62/70] Enhancement: Add SECURITY.md (#739) --- .github/SECURITY.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/SECURITY.md diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000000..9ef1120955 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,17 @@ +# Security Policy + +## Supported Versions + +The following versions of `fakerphp/faker` have active support: + +- `^1.23.0` + +## Unsupported Versions + +The following versions of `fakerphp/faker` have reached their end of life: + +- `<1.23.0` + +## Reporting a Vulnerability + +If you believe that you have found a security vulnerability, please send an email to security@fakerphp.org. Ensure to include all details required to understand the severity of the issue. From 8d32135e606bcc0af4b55db030b672966182ea08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 26 Sep 2023 13:28:24 +0200 Subject: [PATCH 63/70] Fix: Do not use `static` in callables (#785) * Fix: Add tests * Fix: Do not use static in callables --- CHANGELOG.md | 1 + src/Faker/Provider/pt_BR/PhoneNumber.php | 6 +-- test/Faker/Provider/pt_BR/PhoneNumberTest.php | 51 +++++++++++++++++++ 3 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 test/Faker/Provider/pt_BR/PhoneNumberTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 8735e63d36..ded020890b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased](https://github.com/FakerPHP/Faker/compare/v1.23.0...main) - Fixed polish license plates (#685) +- Stopped using `static` in callables in `Provider\pt_BR\PhoneNumber` (#785) ## [2023-06-12, v1.23.0](https://github.com/FakerPHP/Faker/compare/v1.22.0..v1.23.0) diff --git a/src/Faker/Provider/pt_BR/PhoneNumber.php b/src/Faker/Provider/pt_BR/PhoneNumber.php index 6717def5a5..6601658306 100644 --- a/src/Faker/Provider/pt_BR/PhoneNumber.php +++ b/src/Faker/Provider/pt_BR/PhoneNumber.php @@ -83,7 +83,7 @@ public static function phone($formatted = true) ['landline', null], ]); - return call_user_func("static::{$options[0]}", $formatted, $options[1]); + return call_user_func([static::class, $options[0]], $formatted, $options[1]); } /** @@ -135,7 +135,7 @@ public function phoneNumber() { $method = static::randomElement(['cellphoneNumber', 'landlineNumber']); - return call_user_func("static::$method", true); + return call_user_func([static::class, $method], true); } /** @@ -145,6 +145,6 @@ public static function phoneNumberCleared() { $method = static::randomElement(['cellphoneNumber', 'landlineNumber']); - return call_user_func("static::$method", false); + return call_user_func([static::class, $method], false); } } diff --git a/test/Faker/Provider/pt_BR/PhoneNumberTest.php b/test/Faker/Provider/pt_BR/PhoneNumberTest.php new file mode 100644 index 0000000000..e9118049a2 --- /dev/null +++ b/test/Faker/Provider/pt_BR/PhoneNumberTest.php @@ -0,0 +1,51 @@ +faker->phone(false); + + self::assertIsString($phoneNumber); + self::assertNotEmpty($phoneNumber); + } + + public function testPhoneReturnsPhoneNumberWhenArgumentIsTrue(): void + { + $phoneNumber = $this->faker->phone(true); + + self::assertIsString($phoneNumber); + self::assertNotEmpty($phoneNumber); + } + + public function testPhoneNumberReturnsPhoneNumber(): void + { + $phoneNumber = $this->faker->phoneNumber(); + + self::assertIsString($phoneNumber); + self::assertNotEmpty($phoneNumber); + } + + public function testPhoneNumberClearedReturnsPhoneNumber(): void + { + $phoneNumber = $this->faker->phoneNumberCleared(); + + self::assertIsString($phoneNumber); + self::assertNotEmpty($phoneNumber); + } + + protected function getProviders(): iterable + { + yield new Provider\pt_BR\PhoneNumber($this->faker); + } +} From abd4e1528ad51ac07fc7f38151bc4dfb887d149f Mon Sep 17 00:00:00 2001 From: Pim Jansen Date: Sun, 15 Oct 2023 12:03:40 +0200 Subject: [PATCH 64/70] Fixed incorrect female name among male names (#794) (#795) Co-authored-by: Daniel Chodusov --- CHANGELOG.md | 1 + src/Faker/Provider/cs_CZ/Person.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ded020890b..eea5886ff9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed polish license plates (#685) - Stopped using `static` in callables in `Provider\pt_BR\PhoneNumber` (#785) +- Fixed incorrect female name (#794) ## [2023-06-12, v1.23.0](https://github.com/FakerPHP/Faker/compare/v1.22.0..v1.23.0) diff --git a/src/Faker/Provider/cs_CZ/Person.php b/src/Faker/Provider/cs_CZ/Person.php index e962fb6d9e..f0bca49e0b 100644 --- a/src/Faker/Provider/cs_CZ/Person.php +++ b/src/Faker/Provider/cs_CZ/Person.php @@ -28,7 +28,7 @@ class Person extends \Faker\Provider\Person protected static $firstNameMale = [ 'Adam', 'Aleš', 'Alois', 'Antonín', 'Bohumil', 'Bohuslav', 'Dagmar', 'Dalibor', 'Daniel', 'David', 'Dominik', 'Dušan', 'Eduard', 'Emil', - 'Filip', 'František', 'Ilona', 'Ivan', 'Ivo', 'Jakub', 'Jan', 'Ján', + 'Filip', 'František', 'Igor', 'Ivan', 'Ivo', 'Jakub', 'Jan', 'Ján', 'Jaromír', 'Jaroslav', 'Jindřich', 'Jiří', 'Josef', 'Jozef', 'Kamil', 'Karel', 'Kryštof', 'Ladislav', 'Libor', 'Lubomír', 'Luboš', 'Luděk', 'Ludvík', 'Lukáš', 'Marcel', 'Marek', 'Martin', 'Matěj', 'Matyáš', From 09cc68abe249f9af7f6af1b754b8fa2d73aaa30f Mon Sep 17 00:00:00 2001 From: Luca Bognolo <11542801+BoGnY@users.noreply.github.com> Date: Thu, 9 Nov 2023 12:11:29 +0100 Subject: [PATCH 65/70] Removed suppressed State from it_IT (#802) Also added lot of male and female names (top 100 italian names) and added translation for countries. --- src/Faker/Provider/it_IT/Address.php | 54 +++++++++---------- src/Faker/Provider/it_IT/Person.php | 79 ++++++++++++++++------------ 2 files changed, 73 insertions(+), 60 deletions(-) diff --git a/src/Faker/Provider/it_IT/Address.php b/src/Faker/Provider/it_IT/Address.php index b9930ff820..efa9dd5e19 100644 --- a/src/Faker/Provider/it_IT/Address.php +++ b/src/Faker/Provider/it_IT/Address.php @@ -12,35 +12,35 @@ class Address extends \Faker\Provider\Address ]; protected static $postcode = ['#####']; protected static $state = [ - 'Agrigento', 'Alessandria', 'Ancona', 'Aosta', 'Arezzo', 'Ascoli Piceno', 'Asti', 'Avellino', 'Bari', 'Barletta-Andria-Trani', 'Belluno', 'Benevento', 'Bergamo', 'Biella', 'Bologna', 'Bolzano', 'Brescia', 'Brindisi', 'Cagliari', 'Caltanissetta', 'Campobasso', 'Carbonia-Iglesias', 'Caserta', 'Catania', 'Catanzaro', 'Chieti', 'Como', 'Cosenza', 'Cremona', 'Crotone', 'Cuneo', 'Enna', 'Fermo', 'Ferrara', 'Firenze', 'Foggia', 'Forlì-Cesena', 'Frosinone', 'Genova', 'Gorizia', 'Grosseto', 'Imperia', 'Isernia', 'La Spezia', 'L\'Aquila', 'Latina', 'Lecce', 'Lecco', 'Livorno', 'Lodi', 'Lucca', 'Macerata', 'Mantova', 'Massa-Carrara', 'Matera', 'Messina', 'Milano', 'Modena', 'Monza e della Brianza', 'Napoli', 'Novara', 'Nuoro', 'Olbia-Tempio', 'Oristano', 'Padova', 'Palermo', 'Parma', 'Pavia', 'Perugia', 'Pesaro e Urbino', 'Pescara', 'Piacenza', 'Pisa', 'Pistoia', 'Pordenone', 'Potenza', 'Prato', 'Ragusa', 'Ravenna', 'Reggio Calabria', 'Reggio Emilia', 'Rieti', 'Rimini', 'Roma', 'Rovigo', 'Salerno', 'Medio Campidano', 'Sassari', 'Savona', 'Siena', 'Siracusa', 'Sondrio', 'Taranto', 'Teramo', 'Terni', 'Torino', 'Ogliastra', 'Trapani', 'Trento', 'Treviso', 'Trieste', 'Udine', 'Varese', 'Venezia', 'Verbano-Cusio-Ossola', 'Vercelli', 'Verona', 'Vibo Valentia', 'Vicenza', 'Viterbo', + 'Agrigento', 'Alessandria', 'Ancona', 'Aosta', 'Arezzo', 'Ascoli Piceno', 'Asti', 'Avellino', 'Bari', 'Barletta-Andria-Trani', 'Belluno', 'Benevento', 'Bergamo', 'Biella', 'Bologna', 'Bolzano', 'Brescia', 'Brindisi', 'Cagliari', 'Caltanissetta', 'Campobasso', 'Caserta', 'Catania', 'Catanzaro', 'Chieti', 'Como', 'Cosenza', 'Cremona', 'Crotone', 'Cuneo', 'Enna', 'Fermo', 'Ferrara', 'Firenze', 'Foggia', 'Forlì-Cesena', 'Frosinone', 'Genova', 'Gorizia', 'Grosseto', 'Imperia', 'Isernia', 'La Spezia', 'L\'Aquila', 'Latina', 'Lecce', 'Lecco', 'Livorno', 'Lodi', 'Lucca', 'Macerata', 'Mantova', 'Massa-Carrara', 'Matera', 'Messina', 'Milano', 'Modena', 'Monza e della Brianza', 'Napoli', 'Novara', 'Nuoro', 'Oristano', 'Padova', 'Palermo', 'Parma', 'Pavia', 'Perugia', 'Pesaro e Urbino', 'Pescara', 'Piacenza', 'Pisa', 'Pistoia', 'Pordenone', 'Potenza', 'Prato', 'Ragusa', 'Ravenna', 'Reggio Calabria', 'Reggio Emilia', 'Rieti', 'Rimini', 'Roma', 'Rovigo', 'Salerno', 'Sassari', 'Savona', 'Siena', 'Siracusa', 'Sondrio', 'Sud Sardegna', 'Taranto', 'Teramo', 'Terni', 'Torino', 'Trapani', 'Trento', 'Treviso', 'Trieste', 'Udine', 'Varese', 'Venezia', 'Verbano-Cusio-Ossola', 'Vercelli', 'Verona', 'Vibo Valentia', 'Vicenza', 'Viterbo', ]; protected static $stateAbbr = [ - 'AG', 'AL', 'AN', 'AO', 'AR', 'AP', 'AT', 'AV', 'BA', 'BT', 'BL', 'BN', 'BG', 'BI', 'BO', 'BZ', 'BS', 'BR', 'CA', 'CL', 'CB', 'CI', 'CE', 'CT', 'CZ', 'CH', 'CO', 'CS', 'CR', 'KR', 'CN', 'EN', 'FM', 'FE', 'FI', 'FG', 'FC', 'FR', 'GE', 'GO', 'GR', 'IM', 'IS', 'SP', 'AQ', 'LT', 'LE', 'LC', 'LI', 'LO', 'LU', 'MC', 'MN', 'MS', 'MT', 'ME', 'MI', 'MO', 'MB', 'NA', 'NO', 'NU', 'OT', 'OR', 'PD', 'PA', 'PR', 'PV', 'PG', 'PU', 'PE', 'PC', 'PI', 'PT', 'PN', 'PZ', 'PO', 'RG', 'RA', 'RC', 'RE', 'RI', 'RN', 'RM', 'RO', 'SA', 'VS', 'SS', 'SV', 'SI', 'SR', 'SO', 'TA', 'TE', 'TR', 'TO', 'OG', 'TP', 'TN', 'TV', 'TS', 'UD', 'VA', 'VE', 'VB', 'VC', 'VR', 'VV', 'VI', 'VT', + 'AG', 'AL', 'AN', 'AO', 'AR', 'AP', 'AT', 'AV', 'BA', 'BT', 'BL', 'BN', 'BG', 'BI', 'BO', 'BZ', 'BS', 'BR', 'CA', 'CL', 'CB', 'CE', 'CT', 'CZ', 'CH', 'CO', 'CS', 'CR', 'KR', 'CN', 'EN', 'FM', 'FE', 'FI', 'FG', 'FC', 'FR', 'GE', 'GO', 'GR', 'IM', 'IS', 'SP', 'AQ', 'LT', 'LE', 'LC', 'LI', 'LO', 'LU', 'MC', 'MN', 'MS', 'MT', 'ME', 'MI', 'MO', 'MB', 'NA', 'NO', 'NU', 'OR', 'PD', 'PA', 'PR', 'PV', 'PG', 'PU', 'PE', 'PC', 'PI', 'PT', 'PN', 'PZ', 'PO', 'RG', 'RA', 'RC', 'RE', 'RI', 'RN', 'RM', 'RO', 'SA', 'SS', 'SV', 'SI', 'SR', 'SO', 'SU', 'TA', 'TE', 'TR', 'TO', 'TP', 'TN', 'TV', 'TS', 'UD', 'VA', 'VE', 'VB', 'VC', 'VR', 'VV', 'VI', 'VT', ]; protected static $country = [ - 'Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antartide (territori a sud del 60° parallelo)', 'Antigua e Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', - 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Bielorussia', 'Belgio', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia e Herzegovina', 'Botswana', 'Bouvet Island (Bouvetoya)', 'Brasile', 'Territorio dell\'arcipelago indiano', 'Isole Vergini Britanniche', 'Brunei Darussalam', 'Bulgaria', 'Burkina Faso', 'Burundi', - 'Cambogia', 'Cameroon', 'Canada', 'Capo Verde', 'Isole Cayman', 'Repubblica Centrale Africana', 'Chad', 'Cile', 'Cina', 'Isola di Pasqua', 'Isola di Cocos (Keeling)', 'Colombia', 'Comoros', 'Congo', 'Isole Cook', 'Costa Rica', 'Costa d\'Avorio', 'Croazia', 'Cuba', 'Cipro', 'Repubblica Ceca', - 'Danimarca', 'Gibuti', 'Repubblica Dominicana', - 'Equador', 'Egitto', 'El Salvador', 'Guinea Equatoriale', 'Eritrea', 'Estonia', 'Etiopia', - 'Isole Faroe', 'Isole Falkland (Malvinas)', 'Fiji', 'Finlandia', 'Francia', 'Guyana Francese', 'Polinesia Francese', 'Territori Francesi del sud', - 'Gabon', 'Gambia', 'Georgia', 'Germania', 'Ghana', 'Gibilterra', 'Grecia', 'Groenlandia', 'Grenada', 'Guadalupa', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana', - 'Haiti', 'Heard Island and McDonald Islands', 'Città del Vaticano', 'Honduras', 'Hong Kong', 'Ungheria', - 'Islanda', 'India', 'Indonesia', 'Iran', 'Iraq', 'Irlanda', 'Isola di Man', 'Israele', 'Italia', - 'Giamaica', 'Giappone', 'Jersey', 'Giordania', - 'Kazakhstan', 'Kenya', 'Kiribati', 'Korea', 'Kuwait', 'Republicca Kirgiza', - 'Repubblica del Laos', 'Latvia', 'Libano', 'Lesotho', 'Liberia', 'Libyan Arab Jamahiriya', 'Liechtenstein', 'Lituania', 'Lussemburgo', - 'Macao', 'Macedonia', 'Madagascar', 'Malawi', 'Malesia', 'Maldive', 'Mali', 'Malta', 'Isole Marshall', 'Martinica', 'Mauritania', 'Mauritius', 'Mayotte', 'Messico', 'Micronesia', 'Moldova', 'Principato di Monaco', 'Mongolia', 'Montenegro', 'Montserrat', 'Marocco', 'Mozambico', 'Myanmar', - 'Namibia', 'Nauru', 'Nepal', 'Antille Olandesi', 'Olanda', 'Nuova Caledonia', 'Nuova Zelanda', 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Isole Norfolk', 'Northern Mariana Islands', 'Norvegia', - 'Oman', - 'Pakistan', 'Palau', 'Palestina', 'Panama', 'Papua Nuova Guinea', 'Paraguay', 'Peru', 'Filippine', 'Pitcairn Islands', 'Polonia', 'Portogallo', 'Porto Rico', + 'Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antartide (territori a sud del 60° parallelo)', 'Antigua e Barbuda', 'Antille Olandesi', 'Arabia Saudita', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', + 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Bielorussia', 'Belgio', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia e Herzegovina', 'Botswana', 'Isola Bouvet', 'Brasile', 'Territorio dell\'arcipelago indiano', 'Isole Vergini Britanniche', 'Brunei', 'Bulgaria', 'Burkina Faso', 'Burundi', + 'Cambogia', 'Cameroon', 'Canada', 'Capo Verde', 'Isole Cayman', 'Repubblica Centrale Africana', 'Chad', 'Cile', 'Cina', 'Isola di Pasqua', 'Isole Cocos', 'Colombia', 'Comore', 'Congo', 'Isole Cook', 'Costa Rica', 'Costa d\'Avorio', 'Croazia', 'Cuba', 'Cipro', 'Repubblica Ceca', + 'Danimarca', 'Repubblica Dominicana', + 'Equador', 'Egitto', 'El Salvador', 'Emirati Arabi Uniti', 'Eritrea', 'Estonia', 'Eswatini', 'Etiopia', + 'Isole Faroe', 'Isole Falkland', 'Fiji', 'Filippine', 'Finlandia', 'Francia', 'Guyana Francese', 'Polinesia Francese', 'Territori Francesi del Sud', + 'Gabon', 'Gambia', 'Georgia', 'Georgia del Sud e Isole Sandwich Australi', 'Germania', 'Ghana', 'Giamaica', 'Giappone', 'Gibilterra', 'Gibuti', 'Giordania', 'Grecia', 'Groenlandia', 'Grenada', 'Guadalupa', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guinea Equatoriale', 'Guyana', + 'Haiti', 'Isole Heard e McDonald', 'Honduras', 'Hong Kong', + 'Islanda', 'India', 'Indonesia', 'Iran', 'Iraq', 'Irlanda', 'Israele', 'Italia', + 'Isola di Jersey', + 'Kazakhstan', 'Kenya', 'Kirghizistan', 'Kiribati', 'Korea', 'Kuwait', + 'Repubblica del Laos', 'Latvia', 'Lesotho', 'Libano', 'Liberia', 'Libia', 'Liechtenstein', 'Lituania', 'Lussemburgo', + 'Macao', 'Macedonia', 'Madagascar', 'Malawi', 'Malesia', 'Maldive', 'Mali', 'Malta', 'Isola di Man', 'Isole Marianne Settentrionali', 'Isole Marshall', 'Martinica', 'Mauritania', 'Mauritius', 'Mayotte', 'Messico', 'Micronesia', 'Isole Minori esterne degli Stati Uniti d\'America', 'Moldova', 'Principato di Monaco', 'Mongolia', 'Montenegro', 'Montserrat', 'Marocco', 'Mozambico', 'Myanmar', + 'Namibia', 'Nauru', 'Nepal', 'Nuova Caledonia', 'Nuova Zelanda', 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Isole Norfolk', 'Norvegia', + 'Olanda', 'Oman', + 'Pakistan', 'Palau', 'Palestina', 'Panama', 'Papua Nuova Guinea', 'Paraguay', 'Peru', 'Isole Pitcairn', 'Polonia', 'Portogallo', 'Porto Rico', 'Qatar', - 'Reunion', 'Romania', 'Russia', 'Rwanda', - 'San Bartolomeo', 'Sant\'Elena', 'Saint Kitts and Nevis', 'Saint Lucia', 'Saint Martin', 'Saint Pierre and Miquelon', 'Saint Vincent and the Grenadines', 'Samoa', 'San Marino', 'Sao Tome and Principe', 'Arabia Saudita', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovenia', 'Isole Solomon', 'Somalia', 'Sud Africa', 'Georgia del sud e South Sandwich Islands', 'Spagna', 'Sri Lanka', 'Sudan', 'Suriname', 'Svalbard & Jan Mayen Islands', 'Swaziland', 'Svezia', 'Svizzera', 'Siria', - 'Taiwan', 'Tajikistan', 'Tanzania', 'Tailandia', 'Timor-Leste', 'Togo', 'Tokelau', 'Tonga', 'Trinidad e Tobago', 'Tunisia', 'Turchia', 'Turkmenistan', 'Isole di Turks and Caicos', 'Tuvalu', - 'Uganda', 'Ucraina', 'Emirati Arabi Uniti', 'Regno Unito', 'Stati Uniti d\'America', 'United States Minor Outlying Islands', 'Isole Vergini Statunitensi', 'Uruguay', 'Uzbekistan', - 'Vanuatu', 'Venezuela', 'Vietnam', - 'Wallis and Futuna', 'Western Sahara', + 'Regno Unito', 'Isola della Riunione', 'Romania', 'Russia', 'Rwanda', + 'Sahara Occidentale', 'San Bartolomeo', 'Sant\'Elena', 'Saint Kitts e Nevis', 'Saint Lucia', 'Saint Martin', 'Saint-Pierre e Miquelon', 'Saint Vincent e Grenadine', 'Samoa', 'San Marino', 'Sao Tome e Principe', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovenia', 'Isole Solomon', 'Somalia', 'Spagna', 'Sri Lanka', 'Stati Uniti d\'America', 'Sud Africa', 'Sudan', 'Suriname', 'Isole Svalbard e Jan Mayen', 'Svezia', 'Svizzera', 'Siria', + 'Taiwan', 'Tajikistan', 'Tanzania', 'Tailandia', 'Timor Leste', 'Togo', 'Tokelau', 'Tonga', 'Trinidad e Tobago', 'Tunisia', 'Turchia', 'Turkmenistan', 'Isole di Turks e Caicos', 'Tuvalu', + 'Uganda', 'Ucraina', 'Uruguay', 'Uzbekistan', 'Ungheria', + 'Vanuatu', 'Vaticano', 'Venezuela', 'Isole Vergini Statunitensi', 'Vietnam', + 'Wallis e Futuna', 'Yemen', 'Zambia', 'Zimbabwe', ]; @@ -64,7 +64,7 @@ class Address extends \Faker\Provider\Address protected static $secondaryAddressFormats = ['Appartamento ##', 'Piano #']; /** - * @example 'East' + * @example 'Borgo' */ public static function cityPrefix() { @@ -72,7 +72,7 @@ public static function cityPrefix() } /** - * @example 'Appt. 350' + * @example 'Appartamento 350' */ public static function secondaryAddress() { @@ -80,7 +80,7 @@ public static function secondaryAddress() } /** - * @example 'California' + * @example 'Cagliari' */ public static function state() { diff --git a/src/Faker/Provider/it_IT/Person.php b/src/Faker/Provider/it_IT/Person.php index 9922fd024e..c74052eaec 100644 --- a/src/Faker/Provider/it_IT/Person.php +++ b/src/Faker/Provider/it_IT/Person.php @@ -23,41 +23,54 @@ class Person extends \Faker\Provider\Person ]; protected static $firstNameMale = [ - 'Aaron', 'Abramo', 'Adriano', 'Akira', 'Alan', 'Alberto', 'Albino', 'Alessandro', 'Alessio', 'Amedeo', 'Amos', 'Anastasio', 'Anselmo', - 'Antimo', 'Antonino', 'Antonio', 'Ariel', 'Armando', 'Aroldo', 'Arturo', 'Augusto', 'Battista', 'Bernardo', 'Boris', 'Caio', - 'Carlo', 'Carmelo', 'Ciro', 'Damiano', 'Danny', 'Dante', 'Davide', 'Davis', 'Demis', 'Dimitri', 'Domingo', 'Dylan', - 'Edilio', 'Egidio', 'Elio', 'Emanuel', 'Emidio', 'Enrico', 'Enzo', 'Ercole', 'Ermes', 'Ethan', 'Ettore', 'Eusebio', - 'Fabiano', 'Fabio', 'Ferdinando', 'Fernando', 'Fiorenzo', 'Flavio', 'Folco', 'Fulvio', 'Furio', 'Gabriele', 'Gaetano', 'Gastone', - 'Gavino', 'Gerlando', 'Germano', 'Giacinto', 'Gianantonio', 'Giancarlo', 'Gianmarco', 'Gianmaria', 'Gioacchino', 'Giordano', 'Giorgio', 'Giuliano', - 'Giulio', 'Graziano', 'Gregorio', 'Guido', 'Harry', 'Hector', 'Iacopo', 'Ian', 'Ilario', 'Italo', 'Ivano', 'Jack', - 'Jacopo', 'Jari', 'Jarno', 'Joey', 'Joseph', 'Joshua', 'Kai', 'Karim', 'Kris', 'Lamberto', 'Lauro', 'Lazzaro', - 'Leonardo', 'Liborio', 'Lino', 'Lorenzo', 'Loris', 'Ludovico', 'Luigi', 'Manfredi', 'Manuele', 'Marco', 'Mariano', 'Marino', - 'Marvin', 'Marzio', 'Matteo', 'Mattia', 'Mauro', 'Max', 'Michael', 'Mirco', 'Mirko', 'Modesto', 'Moreno', 'Nabil', - 'Nadir', 'Nathan', 'Nazzareno', 'Nick', 'Nico', 'Noah', 'Noel', 'Omar', 'Oreste', 'Osvaldo', 'Pablo', 'Patrizio', - 'Pietro', 'Priamo', 'Quirino', 'Raoul', 'Renato', 'Renzo', 'Rocco', 'Rodolfo', 'Romeo', 'Romolo', 'Rudy', 'Sabatino', - 'Sabino', 'Samuel', 'Sandro', 'Santo', 'Sebastian', 'Sesto', 'Silvano', 'Silverio', 'Sirio', 'Siro', 'Timoteo', 'Timothy', - 'Tommaso', 'Ubaldo', 'Umberto', 'Vinicio', 'Walter', 'Xavier', 'Yago', 'Alighieri', 'Alighiero', 'Amerigo', 'Arcibaldo', 'Arduino', - 'Artes', 'Audenico', 'Ausonio', 'Bacchisio', 'Baldassarre', 'Bettino', 'Bortolo', 'Caligola', 'Cecco', 'Cirino', 'Cleros', - 'Costantino', 'Costanzo', 'Danthon', 'Demian', 'Domiziano', 'Edipo', 'Egisto', 'Eliziario', 'Eriberto', 'Erminio', - 'Eustachio', 'Evangelista', 'Fiorentino', 'Giacobbe', 'Gianleonardo', 'Gianriccardo', 'Giobbe', 'Ippolito', - 'Isira', 'Joannes', 'Kociss', 'Laerte', 'Maggiore', 'Muzio', 'Nestore', 'Odino', 'Odone', 'Olo', 'Oretta', 'Orfeo', - 'Osea', 'Pacifico', 'Pericle', 'Piererminio', 'Pierfrancesco', 'Piersilvio', 'Primo', 'Quarto', 'Quasimodo', - 'Radames', 'Radio', 'Raniero', 'Rosalino', 'Rosolino', 'Rufo', 'Secondo', 'Tancredi', 'Tazio', 'Terzo', 'Teseo', - 'Tolomeo', 'Trevis', 'Tristano', 'Ulrico', 'Valdo', 'Zaccaria', 'Dindo', 'Serse', + 'Aaron', 'Abramo', 'Adriano', 'Agostino', 'Akira', 'Alan', 'Alberto', 'Albino', 'Aldo', 'Alessandro', 'Alessio', + 'Alfonso', 'Alfredo', 'Alighieri', 'Alighiero', 'Amedeo', 'Amerigo', 'Amos', 'Anastasio', 'Andrea', 'Angelo', + 'Anselmo', 'Antimo', 'Antonino', 'Antonio', 'Arcibaldo', 'Arduino', 'Ariel', 'Armando', 'Aroldo', 'Artes', 'Arturo', + 'Audenico', 'Augusto', 'Ausonio', 'Bacchisio', 'Baldassarre', 'Battista', 'Bernardo', 'Bettino', 'Boris', 'Bortolo', + 'Bruno', 'Caio', 'Caligola', 'Carlo', 'Carmelo', 'Carmine', 'Cecco', 'Cesare', 'Cirino', 'Ciro', 'Claudio', 'Cleros', + 'Corrado', 'Cosimo', 'Costantino', 'Costanzo', 'Damiano', 'Danilo', 'Danny', 'Dante', 'Danthon', 'Dario', 'David', + 'Davide', 'Davis', 'Demian', 'Demis', 'Dimitri', 'Dindo', 'Dino', 'Domenico', 'Domingo', 'Domiziano', 'Donato', 'Dylan', + 'Edilio', 'Edipo', 'Egidio', 'Egisto', 'Elio', 'Eliziario', 'Emanuel', 'Emanuele', 'Emidio', 'Emilio', 'Enrico', 'Enzo', + 'Ercole', 'Eriberto', 'Ermes', 'Erminio', 'Ernesto', 'Ethan', 'Ettore', 'Eugenio', 'Eusebio', 'Eustachio', 'Evangelista', + 'Fabiano', 'Fabio', 'Fabrizio', 'Fausto', 'Federico', 'Felice', 'Ferdinando', 'Fernando', 'Filippo', 'Fiorentino', + 'Fiorenzo', 'Flavio', 'Folco', 'Francesco', 'Franco', 'Fulvio', 'Furio', 'Gabriele', 'Gaetano', 'Gastone', 'Gavino', + 'Gennaro', 'Gerardo', 'Gerlando', 'Germano', 'Giacinto', 'Giacobbe', 'Giacomo', 'Gian', 'Gianantonio', 'Giancarlo', + 'Gianfranco', 'Gianleonardo', 'Gianluca', 'Gianmarco', 'Gianmaria', 'Gianni', 'Gianriccardo', 'Gino', 'Gioacchino', 'Giobbe', + 'Giordano', 'Giorgio', 'Giovanni', 'Giuliano', 'Giulio', 'Giuseppe', 'Graziano', 'Gregorio', 'Guido', 'Harry', 'Hector', + 'Iacopo', 'Ian', 'Ilario', 'Ippolito', 'Isira', 'Italo', 'Ivano', 'Jack', 'Jacopo', 'Jari', 'Jarno', 'Joannes', 'Joey', + 'Joseph', 'Joshua', 'Kai', 'Karim', 'Kociss', 'Kris', 'Laerte', 'Lamberto', 'Lauro', 'Lazzaro', 'Leonardo', 'Liborio', + 'Lino', 'Lorenzo', 'Loris', 'Luca', 'Luciano', 'Ludovico', 'Luigi', 'Maggiore', 'Manfredi', 'Manuele', 'Marcello', + 'Marco', 'Mariano', 'Marino', 'Mario', 'Marvin', 'Marzio', 'Massimiliano', 'Massimo', 'Matteo', 'Mattia', 'Maurizio', + 'Mauro', 'Max', 'Michael', 'Mirco', 'Mirko', 'Modesto', 'Moreno', 'Muzio', 'Nabil', 'Nadir', 'Nathan', 'Nazzareno', + 'Nestore', 'Nick', 'Nico', 'Nicola', 'Noah', 'Noel', 'Odino', 'Odone', 'Olo', 'Omar', 'Oreste', 'Oretta', 'Orfeo', + 'Osea', 'Osvaldo', 'Pablo', 'Pacifico', 'Paolo', 'Pasquale', 'Patrizio', 'Pericle', 'Piererminio', 'Pierfrancesco', + 'Piero', 'Piersilvio', 'Pietro', 'Priamo', 'Primo', 'Quarto', 'Quasimodo', 'Quirino', 'Radames', 'Radio', 'Raffaele', + 'Raniero', 'Raoul', 'Renato', 'Renzo', 'Riccardo', 'Roberto', 'Rocco', 'Rodolfo', 'Romano', 'Romeo', 'Romolo', + 'Rosalino', 'Rosolino', 'Rudy', 'Rufo', 'Sabatino', 'Sabino', 'Salvatore', 'Samuel', 'Sandro', 'Santo', 'Sebastian', + 'Sebastiano', 'Secondo', 'Sergio', 'Serse', 'Sesto', 'Silvano', 'Silverio', 'Silvio', 'Sirio', 'Siro', 'Stefano', + 'Tancredi', 'Tazio', 'Terzo', 'Teseo', 'Timoteo', 'Timothy', 'Tolomeo', 'Tommaso', 'Trevis', 'Tristano', 'Ubaldo', + 'Ugo', 'Ulrico', 'Umberto', 'Valdo', 'Vincenzo', 'Vinicio', 'Vito', 'Vittorio', 'Walter', 'Xavier', 'Yago', 'Zaccaria', ]; protected static $firstNameFemale = [ - 'Assia', 'Benedetta', 'Bibiana', 'Brigitta', 'Carmela', 'Celeste', 'Cira', 'Claudia', 'Concetta', 'Cristyn', 'Deborah', 'Demi', 'Diana', - 'Donatella', 'Doriana', 'Edvige', 'Elda', 'Elga', 'Elsa', 'Emilia', 'Enrica', 'Erminia', 'Evita', 'Fatima', 'Felicia', - 'Filomena', 'Fortunata', 'Gilda', 'Giovanna', 'Giulietta', 'Grazia', 'Helga', 'Ileana', 'Ingrid', 'Ione', 'Irene', 'Isabel', - 'Ivonne', 'Jelena', 'Kayla', 'Kristel', 'Laura', 'Leone', 'Lia', 'Lidia', 'Lisa', 'Loredana', 'Loretta', 'Luce', - 'Lucia', 'Lucrezia', 'Luna', 'Maika', 'Marcella', 'Maria', 'Marianita', 'Mariapia', 'Marina', 'Maristella', 'Maruska', 'Matilde', - 'Mercedes', 'Michele', 'Miriam', 'Miriana', 'Monia', 'Morgana', 'Naomi', 'Neri', 'Nicoletta', 'Ninfa', 'Noemi', 'Nunzia', - 'Olimpia', 'Ortensia', 'Penelope', 'Prisca', 'Rebecca', 'Rita', 'Rosalba', 'Rosaria', 'Rosita', 'Ruth', 'Samira', 'Sarita', - 'Sasha', 'Shaira', 'Thea', 'Ursula', 'Vania', 'Vera', 'Vienna', 'Artemide', 'Cassiopea', 'Cesidia', 'Clea', 'Cleopatra', - 'Clodovea', 'Cosetta', 'Damiana', 'Danuta', 'Diamante', 'Eufemia', 'Flaviana', 'Gelsomina', 'Genziana', 'Giacinta', 'Guendalina', - 'Jole', 'Mariagiulia', 'Marieva', 'Mietta', 'Nayade', 'Piccarda', 'Selvaggia', 'Sibilla', 'Soriana', 'Sue ellen', 'Tosca', 'Violante', - 'Vitalba', 'Zelida', + 'Adriana', 'Alessandra', 'Andrea', 'Angela', 'Angelina', 'Anna', 'Annalisa', 'Annamaria', 'Annunziata', 'Antonella', + 'Antonia', 'Antonietta', 'Antonina', 'Artemide', 'Asia', 'Assia', 'Assunta', 'Barbara', 'Benedetta', 'Bibiana', 'Brigitta', + 'Bruna', 'Carla', 'Carmela', 'Cassiopea', 'Caterina', 'Celeste', 'Cesidia', 'Chiara', 'Cinzia', 'Cira', 'Clara', 'Claudia', + 'Clea', 'Cleopatra', 'Clodovea', 'Concetta', 'Cosetta', 'Cristina', 'Cristyn', 'Damiana', 'Daniela', 'Danuta', 'Deborah', + 'Demi', 'Diamante', 'Diana', 'Domenica', 'Donatella', 'Doriana', 'Edvige', 'Elda', 'Elena', 'Eleonora', 'Elga', 'Elisa', + 'Elisabetta', 'Elsa', 'Emanuela', 'Emilia', 'Enrica', 'Erminia', 'Eufemia', 'Evita', 'Fatima', 'Federica', 'Felicia', + 'Filomena', 'Flaviana', 'Fortunata', 'Franca', 'Francesca', 'Gabriella', 'Gelsomina', 'Genziana', 'Giacinta', 'Gilda', + 'Giovanna', 'Giuliana', 'Giulietta', 'Giuseppa', 'Giuseppina', 'Grazia', 'Graziella', 'Guendalina', 'Helga', 'Ida', 'Ileana', + 'Ingrid', 'Ione', 'Irene', 'Isabel', 'Isabella', 'Ivana', 'Ivonne', 'Jelena', 'Jole', 'Kayla', 'Kristel', 'Laura', 'Leone', + 'Lia', 'Lidia', 'Liliana', 'Lina', 'Lisa', 'Loredana', 'Loretta', 'Luce', 'Lucia', 'Luciana', 'Lucrezia', 'Luisa', 'Luna', + 'Maddalena', 'Maika', 'Manuela', 'Marcella', 'Margherita', 'Maria', 'Mariagiulia', 'Marianita', 'Marianna', 'Mariapia', + 'Marieva', 'Marina', 'Marisa', 'Maristella', 'Marta', 'Maruska', 'Matilde', 'Mercedes', 'Michela', 'Michele', 'Michelle', + 'Mietta', 'Mirella', 'Miriam', 'Miriana', 'Monia', 'Monica', 'Morgana', 'Nadia', 'Naomi', 'Nayade', 'Neri', 'Nicoletta', + 'Ninfa', 'Noemi', 'Nunzia', 'Olimpia', 'Ortensia', 'Paola', 'Patrizia', 'Penelope', 'Piccarda', 'Pierina', 'Prisca', + 'Raffaella', 'Rebecca', 'Renata', 'Rita', 'Roberta', 'Rosa', 'Rosalba', 'Rosalia', 'Rosanna', 'Rosaria', 'Rosita', + 'Ruth', 'Sabrina', 'Samira', 'Sandra', 'Sara', 'Sarah', 'Sarita', 'Sasha', 'Selvaggia', 'Shaira', 'Sibilla', 'Silvana', + 'Silvia', 'Simona', 'Sonia', 'Soriana', 'Stefania', 'Stella', 'Sue ellen', 'Teresa', 'Thea', 'Tiziana', 'Tosca', + 'Ursula', 'Valentina', 'Vania', 'Vera', 'Veronica', 'Vienna', 'Vincenza', 'Violante', 'Vitalba', 'Vittoria', 'Zelida', ]; protected static $lastName = [ @@ -69,7 +82,7 @@ class Person extends \Faker\Provider\Person 'Rizzi', 'Monti', 'Cattaneo', 'Morelli', 'Amato', 'Silvestri', 'Mazza', 'Testa', 'Grassi', 'Pellegrino', 'Carbone', 'Giuliani', 'Benedetti', 'Barone', 'Rossetti', 'Caputo', 'Montanari', 'Guerra', 'Palmieri', 'Bernardi', 'Martino', 'Fiore', 'De rosa', 'Ferretti', 'Bellini', 'Basile', 'Riva', 'Donati', 'Piras', 'Vitali', 'Battaglia', 'Sartori', 'Neri', 'Costantini', - 'Milani', 'Pagano', 'Ruggiero', 'Sorrentino', 'D\'amico', 'Orlando', 'Damico', 'Negri', + 'Milani', 'Pagano', 'Ruggiero', 'Sorrentino', 'D\'amico', 'Orlando', 'Damico', 'Negri', 'Verdi', ]; protected static $titleMale = ['Sig.', 'Dott.', 'Dr.', 'Ing.']; From 0d6194286d941416b09a505d04b504f389664d3b Mon Sep 17 00:00:00 2001 From: SupeRod Date: Tue, 14 Nov 2023 13:56:53 +0800 Subject: [PATCH 66/70] Update Address.php to fix country name errors (#809) --- src/Faker/Provider/zh_CN/Address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faker/Provider/zh_CN/Address.php b/src/Faker/Provider/zh_CN/Address.php index d67e14977e..00b9eb771e 100644 --- a/src/Faker/Provider/zh_CN/Address.php +++ b/src/Faker/Provider/zh_CN/Address.php @@ -101,7 +101,7 @@ class Address extends \Faker\Provider\Address '斯威士兰', '瑞典', '瑞士', '叙利亚', '塔吉克斯坦', '坦桑尼亚', '泰国', '阿拉伯联合酋长国', '多哥', '托克劳群岛', '汤加', '特立尼达和多巴哥', '突尼斯', '土耳其', '土库曼斯坦', - '特克斯和凯科斯群岛(', '图瓦卢', '美国', '乌干达', '乌克兰', + '特克斯和凯科斯群岛', '图瓦卢', '美国', '乌干达', '乌克兰', '英国', '乌拉圭', '乌兹别克斯坦', '瓦努阿图', '梵蒂冈', '委内瑞拉', '越南', '维尔京群岛', '维尔京群岛和圣罗克伊', '威克岛', '瓦里斯和富士那群岛', '西撒哈拉', '也门', '南斯拉夫', From 93bcd9e0af855dcb390271329a4c0e66ae19482b Mon Sep 17 00:00:00 2001 From: Alexander Strizhak Date: Tue, 2 Jan 2024 14:48:14 +0300 Subject: [PATCH 67/70] fix #832 (#836) * fix #832 * review fixes --- CHANGELOG.md | 1 + src/Faker/Generator.php | 2 +- src/Faker/Provider/ru_RU/Person.php | 26 +++-- test/Faker/Provider/ru_RU/PersonTest.php | 138 ++++++++++++++++++++++- 4 files changed, 155 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eea5886ff9..7d08e5fa56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased](https://github.com/FakerPHP/Faker/compare/v1.23.0...main) +- Fixed double `а` female lastName in `ru_RU/Person::name()` (#832) - Fixed polish license plates (#685) - Stopped using `static` in callables in `Provider\pt_BR\PhoneNumber` (#785) - Fixed incorrect female name (#794) diff --git a/src/Faker/Generator.php b/src/Faker/Generator.php index ee58be35f4..f11bc6b6ff 100644 --- a/src/Faker/Generator.php +++ b/src/Faker/Generator.php @@ -463,7 +463,7 @@ * * @property string $lastName * - * @method string lastName() + * @method string lastName($gender = null) * * @property string $title * diff --git a/src/Faker/Provider/ru_RU/Person.php b/src/Faker/Provider/ru_RU/Person.php index 95ec8069a8..b0e17d4e19 100644 --- a/src/Faker/Provider/ru_RU/Person.php +++ b/src/Faker/Provider/ru_RU/Person.php @@ -5,8 +5,8 @@ class Person extends \Faker\Provider\Person { protected static $maleNameFormats = [ - '{{firstNameMale}} {{middleNameMale}} {{lastName}}', - '{{lastName}} {{firstNameMale}} {{middleNameMale}}', + '{{firstNameMale}} {{middleNameMale}} {{lastNameMale}}', + '{{lastNameMale}} {{firstNameMale}} {{middleNameMale}}', ]; /** @@ -14,8 +14,8 @@ class Person extends \Faker\Provider\Person * That list of MALE last names could be safely extended to FEMALE list just by adding 'a' letter at the end */ protected static $femaleNameFormats = [ - '{{firstNameFemale}} {{middleNameFemale}} {{lastName}}а', - '{{lastName}}а {{firstNameFemale}} {{middleNameFemale}}', + '{{firstNameFemale}} {{middleNameFemale}} {{lastNameFemale}}', + '{{lastNameFemale}} {{firstNameFemale}} {{middleNameFemale}}', ]; /** @@ -165,16 +165,24 @@ public function middleName($gender = null) */ public function lastName($gender = null) { - $lastName = static::randomElement(static::$lastName); - if (static::GENDER_FEMALE === $gender) { - return $lastName . 'а'; + return $this->lastNameFemale(); } if (static::GENDER_MALE === $gender) { - return $lastName; + return $this->lastNameMale(); } - return $lastName . static::randomElement(static::$lastNameSuffix); + return static::randomElement(static::$lastName) . static::randomElement(static::$lastNameSuffix); + } + + public function lastNameMale(): string + { + return static::randomElement(static::$lastName); + } + + public function lastNameFemale(): string + { + return static::randomElement(static::$lastName) . 'а'; } } diff --git a/test/Faker/Provider/ru_RU/PersonTest.php b/test/Faker/Provider/ru_RU/PersonTest.php index aa34376d4d..d1b34a8806 100644 --- a/test/Faker/Provider/ru_RU/PersonTest.php +++ b/test/Faker/Provider/ru_RU/PersonTest.php @@ -2,6 +2,7 @@ namespace Faker\Test\Provider\ru_RU; +use Faker\Generator; use Faker\Provider\ru_RU\Person; use Faker\Test\TestCase; @@ -10,12 +11,12 @@ */ final class PersonTest extends TestCase { - public function testLastNameFemale(): void + public function testLastNameForFemale(): void { self::assertEquals('а', substr($this->faker->lastName('female'), -2, 2)); } - public function testLastNameMale(): void + public function testLastNameForMale(): void { self::assertNotEquals('а', substr($this->faker->lastName('male'), -2, 2)); } @@ -29,4 +30,137 @@ protected function getProviders(): iterable { yield new Person($this->faker); } + + /** + * @dataProvider dataLastNameMale + */ + public function testLastNameMale(int $seed, string $expected): void + { + $generator = new Generator(); + $generator->seed($seed); + + $provider = new Person($generator); + + self::assertSame($expected, $provider->lastNameMale()); + } + + public function dataLastNameMale(): iterable + { + yield 'seed: 4' => [ + 4, + 'Морозов', + ]; + + yield 'seed: 8' => [ + 8, + 'Гусев', + ]; + + yield 'seed: 15' => [ + 15, + 'Алексеев', + ]; + + yield 'seed: 16' => [ + 16, + 'Фадеев', + ]; + + yield 'seed: 23' => [ + 23, + 'Воронов', + ]; + + yield 'seed: 42' => [ + 42, + 'Горбачёв', + ]; + } + + /** + * @dataProvider dataLastNameFemale + */ + public function testLastNameFemale(int $seed, string $expected): void + { + $generator = new Generator(); + $generator->seed($seed); + + $provider = new Person($generator); + + self::assertSame($expected, $provider->lastNameFemale()); + } + + public function dataLastNameFemale(): iterable + { + yield 'seed: 4' => [ + 4, + 'Морозова', + ]; + + yield 'seed: 8' => [ + 8, + 'Гусева', + ]; + + yield 'seed: 15' => [ + 15, + 'Алексеева', + ]; + + yield 'seed: 16' => [ + 16, + 'Фадеева', + ]; + + yield 'seed: 23' => [ + 23, + 'Воронова', + ]; + + yield 'seed: 42' => [ + 42, + 'Горбачёва', + ]; + } + + /** + * Issue 832 + * + * @dataProvider dataFemaleSurnameWithoutDoubleALetter + */ + public function testFemaleSurnameWithoutDoubleALetter(int $seed, string $expected): void + { + $generator = new Generator(); + $generator->seed($seed); + + foreach ($this->getProviders() as $provider) { + $generator->addProvider($provider); + } + + self::assertSame($expected, $generator->name('female')); + } + + public static function dataFemaleSurnameWithoutDoubleALetter(): iterable + { + //bad cases + yield 'seed: 55' => [ + 55, + 'Ларионова Алиса Александровна', + ]; + + yield 'seed: 512' => [ + 512, + 'Тихонова Галина Андреевна', + ]; + + yield 'seed: 625' => [ + 625, + 'Ларионова Изабелла Романовна', + ]; + + yield 'seed: 1917' => [ + 1917, + 'Павлова Владлена Романовна', + ]; + } } From 77cec4d4b31eeb4bd387170c0958b9d2bf4b36e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 2 Jan 2024 14:34:39 +0100 Subject: [PATCH 68/70] Fix: Do not use deprecated `MT_RAND_PHP` constant on PHP 8.3 (#844) --- .github/workflows/tests.yaml | 5 +-- CHANGELOG.md | 1 + src/Faker/Generator.php | 14 ++++++- test/Faker/Core/DateTimeTest.php | 48 ++++++++++++++++++++++ test/Faker/Core/UuidTest.php | 3 ++ test/Faker/GeneratorTest.php | 3 ++ test/Faker/Provider/BaseTest.php | 2 + test/Faker/Provider/BiasedTest.php | 3 ++ test/Faker/Provider/UuidTest.php | 3 ++ test/Faker/Provider/en_GB/CompanyTest.php | 6 +++ test/Faker/Provider/fi_FI/PersonTest.php | 2 + test/Faker/Provider/fr_FR/AddressTest.php | 6 +++ test/Faker/Provider/fr_FR/ColorTest.php | 6 +++ test/Faker/Provider/hu_HU/PersonTest.php | 3 ++ test/Faker/Provider/ja_JP/InternetTest.php | 6 +++ test/Faker/Provider/ja_JP/PersonTest.php | 15 +++++++ test/Faker/Provider/pl_PL/ColorTest.php | 6 +++ test/Faker/Provider/ru_RU/PersonTest.php | 6 +++ test/Faker/Provider/sv_SE/PersonTest.php | 2 + test/Faker/Provider/uk_UA/PersonTest.php | 15 +++++++ 20 files changed, 150 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 64807579bb..0c42c78fa7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -22,9 +22,7 @@ jobs: - "8.0" - "8.1" - "8.2" - include: - - experimental: true - php-version: "8.3" + - "8.3" runs-on: "ubuntu-latest" @@ -57,4 +55,3 @@ jobs: - name: "Run tests" run: "./vendor/bin/phpunit --colors=always" - continue-on-error: "${{ matrix.experimental }}" diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d08e5fa56..fb436288f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Fixed polish license plates (#685) - Stopped using `static` in callables in `Provider\pt_BR\PhoneNumber` (#785) - Fixed incorrect female name (#794) +- Stopped using the deprecated `MT_RAND_PHP` constant to seed the random generator on PHP 8.3 (#844) ## [2023-06-12, v1.23.0](https://github.com/FakerPHP/Faker/compare/v1.22.0..v1.23.0) diff --git a/src/Faker/Generator.php b/src/Faker/Generator.php index f11bc6b6ff..0b994e4c97 100644 --- a/src/Faker/Generator.php +++ b/src/Faker/Generator.php @@ -687,10 +687,22 @@ public function seed($seed = null) if ($seed === null) { mt_srand(); } else { - mt_srand((int) $seed, MT_RAND_PHP); + mt_srand((int) $seed, self::mode()); } } + /** + * @see https://www.php.net/manual/en/migration83.deprecated.php#migration83.deprecated.random + */ + private static function mode(): int + { + if (PHP_VERSION_ID < 80300) { + return MT_RAND_PHP; + } + + return MT_RAND_MT19937; + } + public function format($format, $arguments = []) { return call_user_func_array($this->getFormatter($format), $arguments); diff --git a/test/Faker/Core/DateTimeTest.php b/test/Faker/Core/DateTimeTest.php index f51cbc378d..af4902c267 100644 --- a/test/Faker/Core/DateTimeTest.php +++ b/test/Faker/Core/DateTimeTest.php @@ -24,6 +24,9 @@ protected function setUp(): void $this->extension = $this->faker->ext(DateTimeExtension::class); } + /** + * @requires PHP < 8.3 + */ public function testDateTime(): void { $dateTime = $this->extension->dateTime('2005-10-19T14:12:00'); @@ -32,6 +35,9 @@ public function testDateTime(): void self::assertEquals(new \DateTime('1990-09-29T12:12:53'), $dateTime); } + /** + * @requires PHP < 8.3 + */ public function testDateTimeWithTimezone(): void { $dateTime = $this->extension->dateTime('2021-09-05T15:10:00', 'America/Los_Angeles'); @@ -41,6 +47,9 @@ public function testDateTimeWithTimezone(): void self::assertEquals(new \DateTimeZone('America/Los_Angeles'), $dateTime->getTimezone()); } + /** + * @requires PHP < 8.3 + */ public function testDateTimeAD(): void { $dateTime = $this->extension->dateTimeAD('2012-04-12T19:22:23'); @@ -49,6 +58,9 @@ public function testDateTimeAD(): void self::assertEquals(new \DateTime('1166-06-01T17:43:42'), $dateTime); } + /** + * @requires PHP < 8.3 + */ public function testDateTimeBetween(): void { $dateTime = $this->extension->dateTimeBetween('1998-12-18T11:23:40', '2004-09-15T22:10:45'); @@ -63,6 +75,9 @@ public function testDateTimeBetweenShouldThrowIfFromIsNotAnteriorToUntil(): void $this->extension->dateTimeBetween('2004-09-15T22:10:45', '1998-12-18T11:23:40'); } + /** + * @requires PHP < 8.3 + */ public function testDateTimeInInterval(): void { $dateTime = $this->extension->dateTimeInInterval('1999-07-16T17:30:12', '+2 years'); @@ -120,6 +135,9 @@ public function testDateTimeThisCentury(): void self::assertLessThanOrEqual(new \DateTime('now'), $dateTime); } + /** + * @requires PHP < 8.3 + */ public function testDate(): void { $date = $this->extension->date('Y-m-d', '2102-11-12T14:45:29'); @@ -128,6 +146,9 @@ public function testDate(): void self::assertEquals('2046-12-26', $date); } + /** + * @requires PHP < 8.3 + */ public function testTime(): void { $time = $this->extension->time('H:i:s', '1978-06-27T09:43:21'); @@ -136,6 +157,9 @@ public function testTime(): void self::assertEquals('21:59:44', $time); } + /** + * @requires PHP < 8.3 + */ public function testUnixTime(): void { $unixTime = $this->extension->unixTime('1993-08-29T15:10:00'); @@ -144,6 +168,9 @@ public function testUnixTime(): void self::assertEquals(432630664, $unixTime); } + /** + * @requires PHP < 8.3 + */ public function testUnitTimeWithNumericUntil(): void { $unixTime = $this->extension->unixTime(1643830258); @@ -152,6 +179,9 @@ public function testUnitTimeWithNumericUntil(): void self::assertEquals(952499510, $unixTime); } + /** + * @requires PHP < 8.3 + */ public function testIso8601(): void { $iso8601 = $this->extension->iso8601('1993-07-11T15:10:00'); @@ -170,6 +200,9 @@ public function testAmPm(): void self::assertContains($amPm, ['am', 'pm']); } + /** + * @requires PHP < 8.3 + */ public function testDayOfMonth(): void { $dayOfMonth = $this->extension->dayOfMonth('2001-04-29T15:10:12'); @@ -178,6 +211,9 @@ public function testDayOfMonth(): void self::assertEquals('25', $dayOfMonth); } + /** + * @requires PHP < 8.3 + */ public function testDayOfWeek(): void { $dayOfWeek = $this->extension->dayOfWeek('2021-12-12T15:10:00'); @@ -186,6 +222,9 @@ public function testDayOfWeek(): void self::assertEquals('Monday', $dayOfWeek); } + /** + * @requires PHP < 8.3 + */ public function testMonth(): void { $month = $this->extension->month('2021-05-23T15:10:00'); @@ -194,6 +233,9 @@ public function testMonth(): void self::assertEquals('10', $month); } + /** + * @requires PHP < 8.3 + */ public function testMonthName(): void { $monthName = $this->extension->monthName('2021-06-06T15:10:00'); @@ -202,6 +244,9 @@ public function testMonthName(): void self::assertEquals('October', $monthName); } + /** + * @requires PHP < 8.3 + */ public function testYear(): void { $year = $this->extension->year('2021-09-12T15:10:00'); @@ -210,6 +255,9 @@ public function testYear(): void self::assertEquals('1999', $year); } + /** + * @requires PHP < 8.3 + */ public function testCentury(): void { $century = $this->extension->century(); diff --git a/test/Faker/Core/UuidTest.php b/test/Faker/Core/UuidTest.php index a0bedce026..045fdad67a 100644 --- a/test/Faker/Core/UuidTest.php +++ b/test/Faker/Core/UuidTest.php @@ -14,6 +14,9 @@ public function testUuidReturnsUuid(): void self::assertTrue($this->isUuid($uuid)); } + /** + * @requires PHP < 8.3 + */ public function testUuidExpectedSeed(): void { $instance = new Uuid(); diff --git a/test/Faker/GeneratorTest.php b/test/Faker/GeneratorTest.php index 3adcf06534..6b79db0aa8 100644 --- a/test/Faker/GeneratorTest.php +++ b/test/Faker/GeneratorTest.php @@ -245,6 +245,9 @@ public function testUniqueReturnsDifferentUniqueGeneratorWhenResetIsTrue(): void self::assertNotSame($uniqueGenerator, $generator->unique(true)); } + /** + * @requires PHP < 8.3 + */ public function testUniqueReturnsUniqueGeneratorThatGeneratesUniqueValues(): void { $words = [ diff --git a/test/Faker/Provider/BaseTest.php b/test/Faker/Provider/BaseTest.php index 78d3b24042..3879ea60fc 100644 --- a/test/Faker/Provider/BaseTest.php +++ b/test/Faker/Provider/BaseTest.php @@ -410,6 +410,8 @@ public function testOptionalAllowsChainingProviderCallRandomlyReturnNull(): void /** * @see https://github.com/fzaninotto/Faker/issues/265 + * + * @requires PHP < 8.3 */ public function testOptionalPercentageAndWeight(): void { diff --git a/test/Faker/Provider/BiasedTest.php b/test/Faker/Provider/BiasedTest.php index 80eb9cb6ab..4eb525795e 100644 --- a/test/Faker/Provider/BiasedTest.php +++ b/test/Faker/Provider/BiasedTest.php @@ -42,6 +42,9 @@ public function testUnbiased(): void } } + /** + * @requires PHP < 8.3 + */ public function testLinearHigh(): void { $this->performFake(['\Faker\Provider\Biased', 'linearHigh']); diff --git a/test/Faker/Provider/UuidTest.php b/test/Faker/Provider/UuidTest.php index ea410ffe6c..c8b324f62c 100644 --- a/test/Faker/Provider/UuidTest.php +++ b/test/Faker/Provider/UuidTest.php @@ -16,6 +16,9 @@ public function testUuidReturnsUuid(): void self::assertTrue($this->isUuid($uuid)); } + /** + * @requires PHP < 8.3 + */ public function testUuidExpectedSeed(): void { if (pack('L', 0x6162797A) == pack('N', 0x6162797A)) { diff --git a/test/Faker/Provider/en_GB/CompanyTest.php b/test/Faker/Provider/en_GB/CompanyTest.php index 125ba2e56e..7780b1f5c7 100644 --- a/test/Faker/Provider/en_GB/CompanyTest.php +++ b/test/Faker/Provider/en_GB/CompanyTest.php @@ -26,6 +26,9 @@ public function testModulus97AlgorithmWithInvalidArgument(): void $this->faker->calculateModulus97(123); } + /** + * @requires PHP < 8.3 + */ public function testVat(): void { $this->assertDefaultVatFormat($this->faker->vat()); @@ -37,6 +40,9 @@ private function assertDefaultVatFormat($number): void self::assertEquals(1, preg_match('/^GB[\d]{3} [\d]{4} [\d]{2}$/', $number)); } + /** + * @requires PHP < 8.3 + */ public function testVatBranchType(): void { $number = $this->faker->vat(Company::VAT_TYPE_BRANCH); diff --git a/test/Faker/Provider/fi_FI/PersonTest.php b/test/Faker/Provider/fi_FI/PersonTest.php index 51fe056ab5..4a420429f2 100644 --- a/test/Faker/Provider/fi_FI/PersonTest.php +++ b/test/Faker/Provider/fi_FI/PersonTest.php @@ -23,6 +23,8 @@ public function provideSeedAndExpectedReturn() } /** + * @requires PHP < 8.3 + * * @dataProvider provideSeedAndExpectedReturn */ public function testPersonalIdentityNumberUsesBirthDateIfProvided($seed, $birthdate, $expected): void diff --git a/test/Faker/Provider/fr_FR/AddressTest.php b/test/Faker/Provider/fr_FR/AddressTest.php index c2bd8697b4..81a1c1909f 100644 --- a/test/Faker/Provider/fr_FR/AddressTest.php +++ b/test/Faker/Provider/fr_FR/AddressTest.php @@ -18,12 +18,18 @@ public function testPostcode(): void self::assertMatchesRegularExpression('@^\d{5}$@', $postcode); } + /** + * @requires PHP < 8.3 + */ public function testSecondaryAddress(): void { self::assertEquals('Étage 007', $this->faker->secondaryAddress()); self::assertEquals('Bât. 932', $this->faker->secondaryAddress()); } + /** + * @requires PHP < 8.3 + */ public function testRegion(): void { self::assertEquals('Occitanie', $this->faker->region()); diff --git a/test/Faker/Provider/fr_FR/ColorTest.php b/test/Faker/Provider/fr_FR/ColorTest.php index e9b1d34c93..8a003db672 100644 --- a/test/Faker/Provider/fr_FR/ColorTest.php +++ b/test/Faker/Provider/fr_FR/ColorTest.php @@ -10,12 +10,18 @@ */ final class ColorTest extends TestCase { + /** + * @requires PHP < 8.3 + */ public function testColorName(): void { self::assertEquals('Mandarine', $this->faker->colorName()); self::assertEquals('Acajou', $this->faker->colorName()); } + /** + * @requires PHP < 8.3 + */ public function testSafeColorName(): void { self::assertEquals('bleu', $this->faker->safeColorName()); diff --git a/test/Faker/Provider/hu_HU/PersonTest.php b/test/Faker/Provider/hu_HU/PersonTest.php index 8618cafdff..dcb46a5a89 100644 --- a/test/Faker/Provider/hu_HU/PersonTest.php +++ b/test/Faker/Provider/hu_HU/PersonTest.php @@ -10,6 +10,9 @@ */ final class PersonTest extends TestCase { + /** + * @requires PHP < 8.3 + */ public function testValidMariedFemaleLastnames(): void { self::assertEquals('Báró Vassné Zsóka', $this->faker->name('female')); diff --git a/test/Faker/Provider/ja_JP/InternetTest.php b/test/Faker/Provider/ja_JP/InternetTest.php index 8837fe910a..8d68036412 100644 --- a/test/Faker/Provider/ja_JP/InternetTest.php +++ b/test/Faker/Provider/ja_JP/InternetTest.php @@ -10,11 +10,17 @@ */ final class InternetTest extends TestCase { + /** + * @requires PHP < 8.3 + */ public function testUserName(): void { self::assertEquals('akira72', $this->faker->userName); } + /** + * @requires PHP < 8.3 + */ public function testDomainName(): void { self::assertEquals('nakajima.com', $this->faker->domainName); diff --git a/test/Faker/Provider/ja_JP/PersonTest.php b/test/Faker/Provider/ja_JP/PersonTest.php index d16e9f4b3d..0e88976cdd 100644 --- a/test/Faker/Provider/ja_JP/PersonTest.php +++ b/test/Faker/Provider/ja_JP/PersonTest.php @@ -10,26 +10,41 @@ */ final class PersonTest extends TestCase { + /** + * @requires PHP < 8.3 + */ public function testKanaNameMaleReturns(): void { self::assertEquals('アオタ ミノル', $this->faker->kanaName('male')); } + /** + * @requires PHP < 8.3 + */ public function testKanaNameFemaleReturns(): void { self::assertEquals('アオタ ミキ', $this->faker->kanaName('female')); } + /** + * @requires PHP < 8.3 + */ public function testFirstKanaNameMaleReturns(): void { self::assertEquals('ヒデキ', $this->faker->firstKanaName('male')); } + /** + * @requires PHP < 8.3 + */ public function testFirstKanaNameFemaleReturns(): void { self::assertEquals('マアヤ', $this->faker->firstKanaName('female')); } + /** + * @requires PHP < 8.3 + */ public function testLastKanaNameReturnsNakajima(): void { self::assertEquals('ナカジマ', $this->faker->lastKanaName); diff --git a/test/Faker/Provider/pl_PL/ColorTest.php b/test/Faker/Provider/pl_PL/ColorTest.php index 885e809688..e5c436548b 100644 --- a/test/Faker/Provider/pl_PL/ColorTest.php +++ b/test/Faker/Provider/pl_PL/ColorTest.php @@ -10,12 +10,18 @@ */ final class ColorTest extends TestCase { + /** + * @requires PHP < 8.3 + */ public function testColorName(): void { self::assertEquals('mysi', $this->faker->colorName()); self::assertEquals('alabastrowy', $this->faker->colorName()); } + /** + * @requires PHP < 8.3 + */ public function testSafeColorName(): void { self::assertEquals('żółty', $this->faker->safeColorName()); diff --git a/test/Faker/Provider/ru_RU/PersonTest.php b/test/Faker/Provider/ru_RU/PersonTest.php index d1b34a8806..5786be79a1 100644 --- a/test/Faker/Provider/ru_RU/PersonTest.php +++ b/test/Faker/Provider/ru_RU/PersonTest.php @@ -32,6 +32,8 @@ protected function getProviders(): iterable } /** + * @requires PHP < 8.3 + * * @dataProvider dataLastNameMale */ public function testLastNameMale(int $seed, string $expected): void @@ -78,6 +80,8 @@ public function dataLastNameMale(): iterable } /** + * @requires PHP < 8.3 + * * @dataProvider dataLastNameFemale */ public function testLastNameFemale(int $seed, string $expected): void @@ -126,6 +130,8 @@ public function dataLastNameFemale(): iterable /** * Issue 832 * + * @requires PHP < 8.3 + * * @dataProvider dataFemaleSurnameWithoutDoubleALetter */ public function testFemaleSurnameWithoutDoubleALetter(int $seed, string $expected): void diff --git a/test/Faker/Provider/sv_SE/PersonTest.php b/test/Faker/Provider/sv_SE/PersonTest.php index b2182dc541..1cbbfbe30f 100644 --- a/test/Faker/Provider/sv_SE/PersonTest.php +++ b/test/Faker/Provider/sv_SE/PersonTest.php @@ -23,6 +23,8 @@ public function provideSeedAndExpectedReturn() } /** + * @requires PHP < 8.3 + * * @dataProvider provideSeedAndExpectedReturn */ public function testPersonalIdentityNumberUsesBirthDateIfProvided($seed, $birthdate, $expected): void diff --git a/test/Faker/Provider/uk_UA/PersonTest.php b/test/Faker/Provider/uk_UA/PersonTest.php index 3773c984b0..2d7e95ebfb 100644 --- a/test/Faker/Provider/uk_UA/PersonTest.php +++ b/test/Faker/Provider/uk_UA/PersonTest.php @@ -10,26 +10,41 @@ */ final class PersonTest extends TestCase { + /** + * @requires PHP < 8.3 + */ public function testFirstNameMaleReturns(): void { self::assertEquals('Максим', $this->faker->firstNameMale()); } + /** + * @requires PHP < 8.3 + */ public function testFirstNameFemaleReturns(): void { self::assertEquals('Людмила', $this->faker->firstNameFemale()); } + /** + * @requires PHP < 8.3 + */ public function testMiddleNameMaleReturns(): void { self::assertEquals('Миколайович', $this->faker->middleNameMale()); } + /** + * @requires PHP < 8.3 + */ public function testMiddleNameFemaleReturns(): void { self::assertEquals('Миколаївна', $this->faker->middleNameFemale()); } + /** + * @requires PHP < 8.3 + */ public function testLastNameReturns(): void { self::assertEquals('Броваренко', $this->faker->lastName()); From 09585c334f4e4614b8d09b019cd55f4156649dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 2 Jan 2024 14:44:42 +0100 Subject: [PATCH 69/70] Enhancement: Prepare release for 1.23.1 (#788) --- CHANGELOG.md | 4 +++- composer.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb436288f5..d7f8396dc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # CHANGELOG -## [Unreleased](https://github.com/FakerPHP/Faker/compare/v1.23.0...main) +## [Unreleased](https://github.com/FakerPHP/Faker/compare/v1.23.1...1.23) + +## [2023-09-29, v1.23.1](https://github.com/FakerPHP/Faker/compare/v1.23.0..v1.23.1) - Fixed double `а` female lastName in `ru_RU/Person::name()` (#832) - Fixed polish license plates (#685) diff --git a/composer.json b/composer.json index 9b85ce9d43..8a2d482f51 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,7 @@ }, "extra": { "branch-alias": { - "dev-main": "v1.21-dev" + "dev-1.23": "v1.23-dev" } } } From bfb4fe148adbf78eff521199619b93a52ae3554b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 2 Jan 2024 14:46:09 +0100 Subject: [PATCH 70/70] Fix: Remove branch alias (#843) --- composer.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/composer.json b/composer.json index 8a2d482f51..88724f2a60 100644 --- a/composer.json +++ b/composer.json @@ -52,10 +52,5 @@ "composer/package-versions-deprecated": true }, "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-1.23": "v1.23-dev" - } } }