├── .gitignore ├── .gitlab-ci.yml ├── LICENSE ├── README.md ├── composer.json ├── phpstan.neon ├── src ├── AutoInstances.php ├── Enum.php ├── Internal │ ├── ConsistencyChecker.php │ ├── InstanceRegister.php │ └── Meta.php └── exceptions.php └── tests ├── Basic ├── accessing-scalar-value.phpt ├── autoinstances.phpt ├── equals.phpt ├── non-strict-value-comparison.phpt ├── stateMachine.phpt └── strict-value-comparison.phpt ├── Consistency ├── finalAndAbstractCheck.phpt ├── methodAnnotations.missing.phpt └── missingInstance.phpt ├── Example ├── AddingBehaviourToEnum │ ├── readme.md │ ├── step-1.phpt │ ├── step-2.phpt │ └── step-3.phpt ├── LoyaltyProgramExample │ └── example.phpt ├── MigratingLegacyCode │ ├── readme.md │ ├── step0.phpt │ ├── step1.phpt │ ├── step2.phpt │ └── step3.phpt └── OrderState │ ├── readme.md │ ├── refactoring-1.phpt │ ├── refactoring-2.phpt │ ├── refactoring-3.phpt │ ├── refactoring-4.phpt │ └── refactoring-5.phpt ├── Reflection ├── constantNames.inherited.phpt ├── constantNames.phpt └── getAvailableValues.phpt ├── Regression ├── access-to-non-existing-value-using-static-method-should-throw-an-exception.phpt ├── forgotten-constructor-call.phpt ├── fromScalar-non-existing-values-should-throw-exception.phpt ├── full-classes-as-values.phpt ├── loose-comparison-across-types.phpt └── mixed-key-type-test.phpt ├── bootstrap.php └── php-windows.ini /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | composer.lock 3 | .idea 4 | **/output/* -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/.gitlab-ci.yml -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/README.md -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/composer.json -------------------------------------------------------------------------------- /phpstan.neon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/phpstan.neon -------------------------------------------------------------------------------- /src/AutoInstances.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/src/AutoInstances.php -------------------------------------------------------------------------------- /src/Enum.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/src/Enum.php -------------------------------------------------------------------------------- /src/Internal/ConsistencyChecker.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/src/Internal/ConsistencyChecker.php -------------------------------------------------------------------------------- /src/Internal/InstanceRegister.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/src/Internal/InstanceRegister.php -------------------------------------------------------------------------------- /src/Internal/Meta.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/src/Internal/Meta.php -------------------------------------------------------------------------------- /src/exceptions.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/src/exceptions.php -------------------------------------------------------------------------------- /tests/Basic/accessing-scalar-value.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Basic/accessing-scalar-value.phpt -------------------------------------------------------------------------------- /tests/Basic/autoinstances.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Basic/autoinstances.phpt -------------------------------------------------------------------------------- /tests/Basic/equals.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Basic/equals.phpt -------------------------------------------------------------------------------- /tests/Basic/non-strict-value-comparison.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Basic/non-strict-value-comparison.phpt -------------------------------------------------------------------------------- /tests/Basic/stateMachine.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Basic/stateMachine.phpt -------------------------------------------------------------------------------- /tests/Basic/strict-value-comparison.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Basic/strict-value-comparison.phpt -------------------------------------------------------------------------------- /tests/Consistency/finalAndAbstractCheck.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Consistency/finalAndAbstractCheck.phpt -------------------------------------------------------------------------------- /tests/Consistency/methodAnnotations.missing.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Consistency/methodAnnotations.missing.phpt -------------------------------------------------------------------------------- /tests/Consistency/missingInstance.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Consistency/missingInstance.phpt -------------------------------------------------------------------------------- /tests/Example/AddingBehaviourToEnum/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/AddingBehaviourToEnum/readme.md -------------------------------------------------------------------------------- /tests/Example/AddingBehaviourToEnum/step-1.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/AddingBehaviourToEnum/step-1.phpt -------------------------------------------------------------------------------- /tests/Example/AddingBehaviourToEnum/step-2.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/AddingBehaviourToEnum/step-2.phpt -------------------------------------------------------------------------------- /tests/Example/AddingBehaviourToEnum/step-3.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/AddingBehaviourToEnum/step-3.phpt -------------------------------------------------------------------------------- /tests/Example/LoyaltyProgramExample/example.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/LoyaltyProgramExample/example.phpt -------------------------------------------------------------------------------- /tests/Example/MigratingLegacyCode/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/MigratingLegacyCode/readme.md -------------------------------------------------------------------------------- /tests/Example/MigratingLegacyCode/step0.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/MigratingLegacyCode/step0.phpt -------------------------------------------------------------------------------- /tests/Example/MigratingLegacyCode/step1.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/MigratingLegacyCode/step1.phpt -------------------------------------------------------------------------------- /tests/Example/MigratingLegacyCode/step2.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/MigratingLegacyCode/step2.phpt -------------------------------------------------------------------------------- /tests/Example/MigratingLegacyCode/step3.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/MigratingLegacyCode/step3.phpt -------------------------------------------------------------------------------- /tests/Example/OrderState/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/OrderState/readme.md -------------------------------------------------------------------------------- /tests/Example/OrderState/refactoring-1.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/OrderState/refactoring-1.phpt -------------------------------------------------------------------------------- /tests/Example/OrderState/refactoring-2.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/OrderState/refactoring-2.phpt -------------------------------------------------------------------------------- /tests/Example/OrderState/refactoring-3.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/OrderState/refactoring-3.phpt -------------------------------------------------------------------------------- /tests/Example/OrderState/refactoring-4.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/OrderState/refactoring-4.phpt -------------------------------------------------------------------------------- /tests/Example/OrderState/refactoring-5.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Example/OrderState/refactoring-5.phpt -------------------------------------------------------------------------------- /tests/Reflection/constantNames.inherited.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Reflection/constantNames.inherited.phpt -------------------------------------------------------------------------------- /tests/Reflection/constantNames.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Reflection/constantNames.phpt -------------------------------------------------------------------------------- /tests/Reflection/getAvailableValues.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Reflection/getAvailableValues.phpt -------------------------------------------------------------------------------- /tests/Regression/access-to-non-existing-value-using-static-method-should-throw-an-exception.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Regression/access-to-non-existing-value-using-static-method-should-throw-an-exception.phpt -------------------------------------------------------------------------------- /tests/Regression/forgotten-constructor-call.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Regression/forgotten-constructor-call.phpt -------------------------------------------------------------------------------- /tests/Regression/fromScalar-non-existing-values-should-throw-exception.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Regression/fromScalar-non-existing-values-should-throw-exception.phpt -------------------------------------------------------------------------------- /tests/Regression/full-classes-as-values.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Regression/full-classes-as-values.phpt -------------------------------------------------------------------------------- /tests/Regression/loose-comparison-across-types.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Regression/loose-comparison-across-types.phpt -------------------------------------------------------------------------------- /tests/Regression/mixed-key-type-test.phpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grifart/enum/HEAD/tests/Regression/mixed-key-type-test.phpt -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 |