Compare commits

..

57 Commits
v2.7.50 ... 2.8

Author SHA1 Message Date
Grégoire Paris
8194721a1e Bump phpunit XSD version to 5.2
Some attributes being used in the phpunit configuration files, namely
failOnRisky and failOnWarning were introduced in phpunit 5.2.0. The
Composer configuration shows that tests should run with old versions of
phpunit, but phpunit only validates the configuration against the XSD
since phpunit 7.2.0.
These changes can be tested as follows:

wget http://schema.phpunit.de/5.2/phpunit.xsd
xargs xmllint --schema phpunit.xsd  1>/dev/null
find src -name phpunit.xml.dist| xargs xmllint --schema phpunit.xsd  1>/dev/null

See 7e06a82806
See 46e3745a03/composer.json (L98)
2018-11-11 12:18:13 +01:00
François-Xavier de Guillebon
5694f145b1 Fix ini_get() for boolean values 2018-10-30 17:24:01 +01:00
Gabriel Caruso
11b1f30ef9 [CS] Use combined assignment operators when possible 2018-10-01 23:42:26 -03:00
Nicolas Grekas
f65a559906 Enable native_constant_invocation CS fixer 2018-07-26 13:13:39 +02:00
Christophe Coevoet
dadfb73e2f Enable the fixer enforcing fully-qualified calls for compiler-optimized functions 2018-07-24 12:05:38 +02:00
Fabien Potencier
f87f46e5e1 Merge branch '2.7' into 2.8
* 2.7:
  fixed years in copyright
2018-01-03 08:36:31 +01:00
Nicolas Grekas
a50bb5c44e Merge branch '2.7' into 2.8
* 2.7:
  Clean up
  Update return type in docblock.
  PHP CS Fixer: no need to exclude xml and yml files
  Update LICENSE year... forever
2018-01-02 16:45:49 +01:00
Fabien Potencier
ff0b32db69 Merge branch '2.7' into 2.8
* 2.7:
  fixed some deprecation messages
2017-12-31 06:04:01 +01:00
Nicolas Grekas
5d7aa644f5 Merge branch '2.7' into 2.8
* 2.7:
  [Intl] Make intl-data tests pass and save language aliases again
  Remove useless docblocks
2017-11-05 16:25:56 +01:00
Nicolas Grekas
5990564047 Merge branch '2.7' into 2.8
* 2.7:
  [DI] minor docblock fixes
2017-10-24 15:48:52 +02:00
Nicolas Grekas
f735c66436 Merge branch '2.7' into 2.8
* 2.7: (22 commits)
  Tests and fix for issue in array model data in EntityType field with multiple=true
  [Form] Fixed PercentToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possible
  removed useless PHPDoc
  [Form] Fix FormInterface::submit() annotation
  PdoSessionHandler: fix advisory lock for pgsql when session.sid_bits_per_character > 4
  HttpCache does not consider ESI resources in HEAD requests
  Fix translation for "This field was not expected"
  [Routing] Enhance Route(Collection) docblocks
  Added improvement for accuracy in MoneyToLocalizedStringTransformer.
  Removed unused private property
  Use correct verb form in the pull request template
  Use PHP_MAXPATHLEN in Filesystem.
  Added null as explicit return type (?TokenInterface)
  [FrameworkBundle] Fix Routing\DelegatingLoader
  Render all line breaks according to the exception message
  [Form] Fix phpdoc
  [DI] remove confusing code
  [Form] Fixed GroupSequence with "constraints" option
  [Validator] Clarify UUID validator behavior
  [Filesystem] Fixed makePathRelative
  ...
2017-10-01 23:00:16 +02:00
Nicolas Grekas
13eed20cc4 Merge branch '2.7' into 2.8
* 2.7:
  [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction
2017-09-15 11:59:38 +02:00
Fabien Potencier
151afda88c Merge branch '2.7' into 2.8
* 2.7:
  Fix indent of methods
2017-07-05 09:50:35 +03:00
Fabien Potencier
48b96f2fa9 Merge branch '2.7' into 2.8
* 2.7:
  Using FQ name for PHP_VERSION_ID
  [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323
  Harden the debugging of Twig filters and functions
  bumped Symfony version to 2.7.29
  updated VERSION for 2.7.28
  update CONTRIBUTORS for 2.7.28
  updated CHANGELOG for 2.7.28
2017-06-01 13:52:29 -07:00
Fabien Potencier
6789dc86c9 Merge branch '2.7' into 2.8
* 2.7:
  fail when detecting risky tests
2017-04-12 07:07:15 -07:00
Fabien Potencier
2c8de07a8a fixed Composer constraints 2017-02-18 11:13:35 -08:00
Nicolas Grekas
a6f009ccd5 Merge branch '2.7' into 2.8
* 2.7:
  Update to PHPUnit namespaces
  remove translation data collector when not usable
2017-02-18 18:06:33 +01:00
Fabien Potencier
4f6bbee7b6 Merge branch '2.7' into 2.8
* 2.7:
  fixed typo
  Revert "fixed typo"
  fixed typo
  fixed CS
  Avoid setting request attributes from signature arguments in AnnotationClassLoader
  [DependencyInjection] Add some missing typehints in YamlFileLoader
  [DependencyInjection] minor: Fix a DocBlock
  [HttpKernel] Give higher priority to adding request formats
  [FrameworkBundle] Fix third level headers for MarkdownDescriptor
  [TwigBundle] do not lose already set method calls
  #20411 fix Yaml parsing for very long quoted strings
  CS: apply is_null
  DX: remove invalid inheritdoc
  bumped Symfony version to 2.7.24
  updated VERSION for 2.7.23
  update CONTRIBUTORS for 2.7.23
  updated CHANGELOG for 2.7.23
  [FrameworkBundle] Skip test if xdebug.file_link_format is defined.
2017-01-21 08:40:50 -08:00
Nicolas Grekas
7c46951128 Merge branch '2.7' into 2.8
* 2.7:
  [DI] Dont share service when no id provided
  Fix Container and PhpDumper test inaccuracies
  [DI] Fix missing new line after private alias
  [ClassLoader] Throw an exception if the cache is not writeable
  Fixing regression in TwigEngine exception handling.
2017-01-10 15:03:07 +01:00
Fabien Potencier
4332e482b5 Merge branch '2.7' into 2.8
* 2.7:
  updated LICENSE year
  Fixed `@return self` with `$this`
2017-01-02 12:30:24 -08:00
Fabien Potencier
f7fe9d14e1 Merge branch '2.7' into 2.8
* 2.7:
  [ClassLoader] Use only forward slashes in generated class map
  ensure the proper context for nested validations
  bug #20653 [WebProfilerBundle] Profiler includes ghost panels
2016-11-29 09:25:54 +01:00
Nicolas Grekas
db9c33f62d Merge branch '2.7' into 2.8
* 2.7:
  [ClassLoader] Fix ClassCollectionLoader inlining with __halt_compiler
2016-11-15 07:06:39 -05:00
Nicolas Grekas
a4d05c1031 Merge branch '2.7' into 2.8
* 2.7:
  Compatibility with Twig 1.27
  Enhance GAE compat by removing some realpath()
  bumped Symfony version to 2.7.21
  updated VERSION for 2.7.20
  update CONTRIBUTORS for 2.7.20
  updated CHANGELOG for 2.7.20
  [SecurityBundle] Fix twig-bridge lowest dep
2016-10-28 10:10:49 +02:00
Fabien Potencier
fb50892408 Merge branch '2.7' into 2.8
* 2.7:
  [FrameworkBundle] Fix Incorrect line break in exception message (500 debug page)
  Minor cleanups and improvements
  [form] lazy trans `post_max_size_message`.
  [DI] Fix setting synthetic services on ContainerBuilder
  [ClassLoader] Fix ClassCollectionLoader inlining with declare(strict_types=1)
2016-09-06 16:19:39 -07:00
Nicolas Grekas
2db1c31911 Merge branch '2.7' into 2.8
* 2.7:
  [ClassLoader] Fix tests
  [Debug][HttpKernel][VarDumper] Prepare for committed 7.2 changes
  [DependencyInjection] PhpDumper::isFrozen inconsistency
  [DI] Cleanup array_key_exists
  include dynamic services in list of alternatives
  [Debug] Swap dumper services at bootstrap
2016-08-23 15:37:31 +02:00
Nicolas Grekas
22035eb867 Merge branch '2.7' into 2.8
* 2.7:
  [HttpKernel] fixed internal subrequests having an if-modified-since-header
  [Validator] Added additional MasterCard range to the CardSchemeValidator
  Make the exception message more clear.
  [Form] fixed bug - name in ButtonBuilder
  [ClassLoader] Fix declared classes being computed when not needed
2016-07-10 10:00:51 +02:00
Fabien Potencier
a99a6b0c71 Merge branch '2.7' into 2.8
* 2.7:
  removed dots at the end of @param and @return
  fixed typo
2016-06-29 07:29:29 +02:00
Fabien Potencier
f1cf312c81 Merge branch '2.7' into 2.8
* 2.7:
  [ci] Get ICU/intl from github instead of nebm.ist.utl.pt/~glopes
  [Debug] Fix case sensitivity checks
  [Debug] Fix handling of php7 throwables
  fix high deps tests
  [Process] remove dead code
  [WebProfilerBundle] Add missing use statement.
  [ClassLoader] Fix storing not-found classes in APC cache
  [Form] cs fixes in date types
  [phpunit] disable prophecy
2016-03-30 12:37:34 +02:00
Nicolas Grekas
7d362c2271 Merge branch '2.7' into 2.8
* 2.7:
  [ci] use hirak/prestissimo
  [Filesystem] Fix transient tests
  [HttpFoundation] Avoid warnings when checking malicious IPs
  [HttpFoundation] Set the Content-Range header if the requested Range is unsatisfied

Conflicts:
	src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php
2016-03-10 20:33:53 +01:00
Fabien Potencier
f3037a1d54 Merge branch '2.7' into 2.8
* 2.7:
  Updated all the README files
  [TwigBundle] Fix failing test on appveyor
  Improved the error message when using "@" in a decorated service
  Improve error reporting in router panel of web profiler
  [DoctrineBridge][Form] Fix performance regression in EntityType
  [FrameworkBundle] Fix a regression in handling absolute and namespaced template paths
  Allow to normalize \Traversable
  minor [Form] fix tests added by #16886
  Remove _path from query parameters when fragment is a subrequest and request attributes are already set Added tests for _path removal in FragmentListener
  Simplified everything
  Added a test
  Fixed the problem in an easier way
  Fixed a syntax issue
  Improved the error message when a template is not found
  [CodingStandards] Conformed to coding standards
  [TwigBundle] fixed Include file locations in "Template could not be found" exception
2016-03-04 08:54:35 +01:00
Fabien Potencier
517ab0554b Merge branch '2.7' into 2.8
* 2.7:
  [2.7] Fix tests
  pass triggerDeprecationError arg to parent class
  remove default null value for asset version
  remove duplicated value
  [DependencyInjection] simplify the BC layer
  Change couple of occurences of a public setUp() method to protected
2016-01-30 16:58:35 +01:00
Fabien Potencier
5fe4b278a6 Merge branch '2.7' into 2.8
* 2.7:
  fixed undefined variable
  Fixed the phpDoc of UserInterface
  fixed APCu dep version
  make apc class loader testable against apcu without apc bc layer
  Added support for the `0.0.0.0/0` trusted proxy
  [DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument
  added missing constant
  Added 451 status code
  Remove unnecessary code
  Allow absolute URLs to be displayed in the debug toolbar
  [ClassLoader] Use symfony/polyfill-apcu
  [HttpKernel] Lookup the response even if the lock was released after 2 seconds
2016-01-25 17:29:20 +01:00
Fabien Potencier
0f257ff274 Merge branch '2.7' into 2.8
* 2.7: (28 commits)
  [Process] Use stream based storage to avoid memory issues
  Fix upgrade guides concerning erroneous removal of assets helper
  [Process] Remove a misleading comment
  Fix markdown typo
  ChooseBaseUrl should return an index
  [Form] ChoiceType: Fix a notice when 'choices' normalizer is replaced
  Improve the phpdoc of SplFileInfo methods
  [Process] Use stream based storage to avoid memory issues
  [FrameworkBundle] Don't log twice with the error handler
  Remove useless is_object condition
  [Process] Fix typo, no arguments needed anymore
  [Serializer] Introduce constants for context keys
  Fixed the documentation of VoterInterface::supportsAttribute
  Fixed Bootstrap form theme form "reset" buttons
  Remove useless duplicated tests
  [FrameworkBundle] Optimize framework extension tests
  synchronize 2.7 and 3.0 upgrade files
  fix merge 2.3 into 2.7 for SecureRandom dependency
  Use is_subclass_of instead of reflection
  Use is_subclass_of instead of Reflection when possible
  ...
2016-01-20 13:09:07 +01:00
Nicolas Grekas
f1c1790c27 Merge branch '2.7' into 2.8
* 2.7:
  [ClassLoader] Use symfony/polyfill-apcu
  [HttpFoundation][Cookie] Cookie DateTimeInterface fix
  bumped Symfony version to 2.7.10
  updated VERSION for 2.7.9
  updated CHANGELOG for 2.7.9
  bumped Symfony version to 2.3.38
  updated VERSION for 2.3.37
  update CONTRIBUTORS for 2.3.37
  updated CHANGELOG for 2.3.37

Conflicts:
	composer.json
	src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php
	src/Symfony/Component/HttpKernel/Kernel.php
2016-01-15 10:29:29 +01:00
Fabien Potencier
98e9089a42 Merge branch '2.7' into 2.8
* 2.7:
  updated copyright year
  Update copyright year
  [2.3] Static Code Analysis for Components
2016-01-03 16:33:41 +01:00
Nicolas Grekas
82e77f1f41 Merge branch '2.7' into 2.8
* 2.7:
  [travis] timeout the sigchild tests at 60s
  CS: Single line comments should use double slashes (//) and not hash (#).
  Do not use HttpKernel Extension when not needed for 2.7
  Do not use HttpKernel Extension when not needed
  bumped Symfony version to 2.7.9
  updated VERSION for 2.7.8
  updated CHANGELOG for 2.7.8
  bumped Symfony version to 2.3.37
  updated VERSION for 2.3.36
  update CONTRIBUTORS for 2.3.36
  updated CHANGELOG for 2.3.36
  Revert "Revert "bug #17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)""
  Revert "bug #17052 [2.7] Fixed flatten exception recursion with errors (GrahamCampbell)"
  use nowdoc instead of heredoc

Conflicts:
	src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Security/Acl/Dbal/AclProvider.php
	src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php
2015-12-28 14:12:56 +01:00
Christophe Coevoet
ec74b0a279 Merge branch '2.7' into 2.8
* 2.7:
  [Process] Fix stopping a process on Windows
  Added a test case for the Logger class.
  CS: general fixes
2015-12-05 18:37:59 +01:00
Nicolas Grekas
51f83451bf Merge branch '2.7' into 2.8
* 2.7:
  Always enable clock-mock for HttpFoundation
  [ClassLoader] Fix parsing namespace when token_get_all() is missing
  Bug #16343 [Router] Too many Routes ?
  [Debug] Ensure class declarations are loaded only once
2015-11-26 08:00:59 +01:00
Fabien Potencier
0dcd6ee72b Merge branch '2.7' into 2.8
* 2.7:
  added the new Composer exclude-from-classmap option
  added the new Composer exclude-from-classmap option
  fix expected argument type docblock
  Set back libxml settings after testings.
  fixed Twig deprecation notices
2015-10-30 13:15:42 -07:00
Nicolas Grekas
ecf7ca8db5 Merge branch '2.7' into 2.8
* 2.7:
  [DoctrineBridge] Fix required guess of boolean fields
  [DI] don't use array_map to resolve services
  Remove dead code in the PropertyPath constructor
  [Process] Inherit env vars by default in PhpProcess
  Changed one console output style to avoid visual issues
  [VarDumper] Fix return type and anonymous classes dumping
  [HttpFoundation] Fixes /0 subnet handling in IpUtils
  [Form] Simplify DateTimeToStringTransformer Avoid unneeded catch and re-throw of the same exception.
  [HttpKernel] Remove a duplicate test for the EsiFragmentRenderer

Conflicts:
	src/Symfony/Component/BrowserKit/composer.json
	src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php
2015-10-23 16:52:08 +02:00
Nicolas Grekas
c56d87452d Merge branch '2.7' into 2.8
* 2.7:
  [travis] Load memcache.so
  [2.3] Cherry-pick @group time-sensitive annotations
  [ci] load php_memcache.dll and apcu.so
  [ClassLoader] Split LegacyApcUniversalClassLoaderTest fixtures
2015-10-12 14:43:41 +02:00
Nicolas Grekas
e24c4526e3 Fix merge 2015-10-12 11:27:31 +02:00
Nicolas Grekas
4767983689 Merge branch '2.7' into 2.8
* 2.7:
  [ci] Fix tests requirements
  [ci] SymfonyTestsListener is now auto-registered
  adds validation messages missing italian translations
  [Console] fixed progress bar format on edge cases
  fix bug with set max count, by start method in progress bar

Conflicts:
	src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php
	src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php
	src/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php
	src/Symfony/Component/Security/Acl/Tests/Dbal/AclProviderTest.php
	src/Symfony/Component/Security/Acl/Tests/Dbal/MutableAclProviderTest.php
2015-10-12 11:25:14 +02:00
Nicolas Grekas
eb3bfca3cb [PhpUnit] Auto-register SymfonyTestsListener 2015-10-11 10:29:26 +02:00
Nicolas Grekas
5d6a7c6474 Merge branch '2.7' into 2.8
* 2.7:
  [tests] Use @requires annotation when possible
  [tests] Use @requires annotation when possible
  [ci] Enable collecting and replaying skipped tests
  [Process] Workaround buggy PHP warning
  [Console] Add additional ways to detect OS400 platform
  [Yaml] Allow tabs before comments at the end of a line
  Added more tests for PropertyAccess

Conflicts:
	.travis.yml
	src/Symfony/Bridge/Doctrine/composer.json
	src/Symfony/Bridge/Monolog/composer.json
	src/Symfony/Bridge/ProxyManager/composer.json
	src/Symfony/Bridge/Swiftmailer/composer.json
	src/Symfony/Bridge/Twig/composer.json
	src/Symfony/Bundle/DebugBundle/composer.json
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Bundle/SecurityBundle/composer.json
	src/Symfony/Bundle/TwigBundle/composer.json
	src/Symfony/Bundle/WebProfilerBundle/composer.json
	src/Symfony/Component/Asset/composer.json
	src/Symfony/Component/BrowserKit/composer.json
	src/Symfony/Component/ClassLoader/composer.json
	src/Symfony/Component/Config/composer.json
	src/Symfony/Component/Console/composer.json
	src/Symfony/Component/CssSelector/composer.json
	src/Symfony/Component/Debug/composer.json
	src/Symfony/Component/DependencyInjection/composer.json
	src/Symfony/Component/DomCrawler/composer.json
	src/Symfony/Component/EventDispatcher/composer.json
	src/Symfony/Component/ExpressionLanguage/composer.json
	src/Symfony/Component/Filesystem/composer.json
	src/Symfony/Component/Finder/composer.json
	src/Symfony/Component/Form/composer.json
	src/Symfony/Component/HttpFoundation/composer.json
	src/Symfony/Component/HttpKernel/composer.json
	src/Symfony/Component/Intl/composer.json
	src/Symfony/Component/Locale/composer.json
	src/Symfony/Component/OptionsResolver/composer.json
	src/Symfony/Component/Process/composer.json
	src/Symfony/Component/PropertyAccess/composer.json
	src/Symfony/Component/Routing/composer.json
	src/Symfony/Component/Security/Acl/composer.json
	src/Symfony/Component/Security/Core/composer.json
	src/Symfony/Component/Security/Csrf/composer.json
	src/Symfony/Component/Security/Http/composer.json
	src/Symfony/Component/Security/composer.json
	src/Symfony/Component/Serializer/composer.json
	src/Symfony/Component/Stopwatch/composer.json
	src/Symfony/Component/Templating/composer.json
	src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php
	src/Symfony/Component/Translation/composer.json
	src/Symfony/Component/Validator/composer.json
	src/Symfony/Component/VarDumper/composer.json
	src/Symfony/Component/Yaml/composer.json
2015-10-10 11:36:22 +02:00
Nicolas Grekas
6e0eabdfbd Merge branch '2.7' into 2.8
Conflicts:
	appveyor.yml
2015-10-07 09:09:15 +02:00
Tobias Schultze
650517ffba Merge branch '2.7' into 2.8
Conflicts:
	src/Symfony/Component/Console/Application.php
	src/Symfony/Component/Console/Command/Command.php
	src/Symfony/Component/Console/Formatter/OutputFormatter.php
	src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php
	src/Symfony/Component/Console/Input/Input.php
	src/Symfony/Component/Console/Input/InputArgument.php
	src/Symfony/Component/Console/Input/InputDefinition.php
	src/Symfony/Component/Console/Input/InputOption.php
	src/Symfony/Component/Console/Output/OutputInterface.php
	src/Symfony/Component/Console/Output/StreamOutput.php
	src/Symfony/Component/CssSelector/CssSelector.php
	src/Symfony/Component/DependencyInjection/Container.php
	src/Symfony/Component/DependencyInjection/ContainerBuilder.php
	src/Symfony/Component/DependencyInjection/ContainerInterface.php
	src/Symfony/Component/DependencyInjection/Definition.php
	src/Symfony/Component/DependencyInjection/Scope.php
	src/Symfony/Component/DependencyInjection/ScopeInterface.php
	src/Symfony/Component/Validator/Constraints/Currency.php
	src/Symfony/Component/Validator/Constraints/CurrencyValidator.php
2015-09-29 14:32:55 +02:00
Nicolas Grekas
4cc39a056d Merge branch '2.7' into 2.8
* 2.7:
  Various fixes esp. on Windows
  Fix the validation of form resources to register the default theme
  Fix the retrieval of the value with property path when using a loader
  [appveyor] minor enhancements
  [Process] Disable failing tests on Windows
  [Translation] Fix the string casting in the XliffFileLoader
  Windows and Intl fixes
  Add appveyor.yml for C.I. on Windows
  [VarDumper] fixed HtmlDumper to target specific the head tag
  [travis] merge php: nightly and deps=high test-matrix lines
  consistently use str_replace to unify directory separators
  Support omitting the <target> node in an .xlf file.
  Fix the handling of values for multiple choice types
  moved PHP nightly to PHP 7.0
  [Security] Add missing docblock in PreAuthenticatedToken

Conflicts:
	.travis.yml
2015-08-27 08:53:13 +02:00
Nicolas Grekas
db4b10fd72 Merge branch '2.7' into 2.8
* 2.7:
  [Locale] Add missing @group legacy annotations
  Fix security-acl deps
  Fix doctrine mapping validation type error
  Remove skipping of tests based on ICU data version whenever possible
  Fix the handling of null as locale in the stub intl classes
  do not dump leading backslashes in class names
  fix issue #15377
  Skip ::class constant
  [Config] type specific check for emptiness

Conflicts:
	src/Symfony/Bridge/Twig/composer.json
	src/Symfony/Bundle/SecurityBundle/composer.json
	src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php
	src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php
	src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php
2015-08-01 11:43:59 +02:00
Abdellatif Ait boudad
b590813ab6 Merge remote-tracking branch 'origin/2.7' into 2.8
Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php
	src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php
2015-07-01 14:16:54 +00:00
Nicolas Grekas
7eba7f44f1 Merge branch '2.7' into 2.8
* 2.7:
  [FrameworkBundle] Reuse PropertyAccessor service for ObjectNormalizer
  [VarDumper] Fix dump output for better readability
  [PhpUnitBridge] Enforce @-silencing of deprecation notices according to new policy
2015-06-19 17:09:14 +02:00
Fabien Potencier
321ff8cc0b Merge branch '2.7' into 2.8
* 2.7:
  Fix test name
  fixed CS
  Allow new lines in Messages translated with transchoice() (replacement for #14867)
  [Form] Swap new ChoiceView constructor arguments to ease migrating from the deprecated one
  [2.3] Fix tests on Windows
  [Yaml] remove partial deprecation annotation
  Silence invasive deprecation warnings, opt-in for warnings
  Documenting how to keep option value BC - see #14377

Conflicts:
	src/Symfony/Bridge/Doctrine/composer.json
	src/Symfony/Bridge/Twig/composer.json
2015-06-11 19:27:52 +02:00
Fabien Potencier
b6a03c500e Merge branch '2.7' into 2.8
* 2.7:
  fixed CS
  fixed CS
  fixed CS
  Fix WebProfilerBundle compatiblity with HttpKernel < 2.7
  [Validator] Deprecated PHP7-incompatible constraints and related validators
  [DebugBundle] Allow alternative destination for dumps
  [DebugBundle] Use output mechanism of dumpers instead of echoing
  [DebugBundle] Always collect dumps
  [FrameworkBundle] Applied new styles to the config:debug & config:dump-reference commands
  Fix tests in HHVM
  CS: Pre incrementation/decrementation should be used if possible

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/composer.json
2015-05-15 16:11:12 +02:00
Nicolas Grekas
37df82a1d1 Merge branch '2.7' into 2.8
* 2.7: (70 commits)
  [travis] Use container-based infrastructure
  [HttpKernel] use ConfigCache::getPath() method when it exists
  [PropertyAccess] Fix setting public property on a class having a magic getter
  [Routing] Display file which contain deprecated option
  ContainerInterface: unused exception dropped
  bumped Symfony version to 2.6.8
  updated VERSION for 2.6.7
  updated CHANGELOG for 2.6.7
  bumped Symfony version to 2.3.29
  updated VERSION for 2.3.28
  update CONTRIBUTORS for 2.3.28
  updated CHANGELOG for 2.3.28
  [Debug] Fixed ClassNotFoundFatalErrorHandlerTest
  [SecurityBundle] use access decision constants in config
  [SecurityBundle] use session auth constants in config
  PhpDoc fix in AbstractRememberMeServices
  [Filesystem] Simplified an if statement
  [SecurityBundle] Use Enum Nodes Instead Of Scalar
  [Debug 2.3] Fix test for PHP7
  [HttpKernel] Check if "symfony/proxy-manager-bridge" package is installed
  ...

Conflicts:
	src/Symfony/Bundle/DebugBundle/composer.json
	src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
	src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php
	src/Symfony/Component/Form/README.md
	src/Symfony/Component/Intl/README.md
	src/Symfony/Component/Security/README.md
	src/Symfony/Component/Translation/Loader/CsvFileLoader.php
	src/Symfony/Component/Translation/Loader/IniFileLoader.php
	src/Symfony/Component/Translation/Loader/MoFileLoader.php
	src/Symfony/Component/Translation/Loader/PhpFileLoader.php
	src/Symfony/Component/Translation/Loader/PoFileLoader.php
	src/Symfony/Component/Translation/Loader/YamlFileLoader.php
	src/Symfony/Component/Translation/README.md
	src/Symfony/Component/Translation/Translator.php
	src/Symfony/Component/Validator/README.md
2015-05-12 17:16:46 +02:00
Nicolas Grekas
d5b42e690e Merge branch '2.7' into 2.8
* 2.7: (40 commits)
  [Debug] Fix ClassNotFoundFatalErrorHandler candidates lookups
  [2.6][Translator] Extend, refactor and simplify Translator tests.
  Update DebugClassLoader.php
  inject asset packages in assets helper service
  [travis] Do not exclude legacy tests on 2.7
  [HttpFoundation] remove getExtension method
  [2.6][Translation] fix legacy tests.
  [Form] Removed remaining deprecation notices in the test suite
  [Form] Moved deprecation notice triggers to file level
  [Debug] Map PHP errors to LogLevel::CRITICAL
  [Routing][DependencyInjection] Support .yaml extension in YAML loaders
  [DX] improve file loader error for router/other resources in bundle
  [FrameworkBundle] Initialize translator with the default locale.
  [FrameworkBundle] Fix Routing\DelegatingLoader resiliency to fatal errors
  [2.7][Translation] remove duplicate code for loading catalogue.
  [2.6][Translation] remove duplicate code for loading catalogue.
  [HttpKernel] Cleanup ExceptionListener
  CS fixes
  [DependencyInjection] Show better error when the Yaml component is not installed
  [2.3] SCA for Components - reference mismatches
  ...
2015-04-24 09:03:44 +02:00
Fabien Potencier
52102a05bf updated version to 2.8 2015-04-10 10:56:33 +02:00
Fabien Potencier
fcf53c4728 Revert "removed 3.0 constraints from 2.7 composer files"
This reverts commit 5503804cf91f4ede81b94b34609653c013139038.
2015-04-10 10:55:07 +02:00
19 changed files with 168 additions and 168 deletions

View File

@@ -65,7 +65,7 @@ class ApcClassLoader
*/
public function __construct($prefix, $decorated)
{
if (!function_exists('apcu_fetch')) {
if (!\function_exists('apcu_fetch')) {
throw new \RuntimeException('Unable to use ApcClassLoader as APC is not installed.');
}
@@ -134,6 +134,6 @@ class ApcClassLoader
*/
public function __call($method, $args)
{
return call_user_func_array(array($this->decorated, $method), $args);
return \call_user_func_array(array($this->decorated, $method), $args);
}
}

View File

@@ -74,7 +74,7 @@ class ApcUniversalClassLoader extends UniversalClassLoader
*/
public function __construct($prefix)
{
if (!function_exists('apcu_fetch')) {
if (!\function_exists('apcu_fetch')) {
throw new \RuntimeException('Unable to use ApcUniversalClassLoader as APC is not enabled.');
}

View File

@@ -45,7 +45,7 @@ class ClassCollectionLoader
if ($adaptive) {
$declared = array_merge(get_declared_classes(), get_declared_interfaces());
if (function_exists('get_declared_traits')) {
if (\function_exists('get_declared_traits')) {
$declared = array_merge($declared, get_declared_traits());
}
@@ -53,7 +53,7 @@ class ClassCollectionLoader
$classes = array_diff($classes, $declared);
// the cache is different depending on which classes are already declared
$name = $name.'-'.substr(hash('sha256', implode('|', $classes)), 0, 5);
$name .= '-'.substr(hash('sha256', implode('|', $classes)), 0, 5);
}
$classes = array_unique($classes);
@@ -62,7 +62,7 @@ class ClassCollectionLoader
if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
throw new \RuntimeException(sprintf('Class Collection Loader was not able to create directory "%s"', $cacheDir));
}
$cacheDir = rtrim(realpath($cacheDir) ?: $cacheDir, '/'.DIRECTORY_SEPARATOR);
$cacheDir = rtrim(realpath($cacheDir) ?: $cacheDir, '/'.\DIRECTORY_SEPARATOR);
$cache = $cacheDir.'/'.$name.$extension;
// auto-reload
@@ -99,7 +99,7 @@ class ClassCollectionLoader
}
if (!$adaptive) {
$declared = array_merge(get_declared_classes(), get_declared_interfaces());
if (function_exists('get_declared_traits')) {
if (\function_exists('get_declared_traits')) {
$declared = array_merge($declared, get_declared_traits());
}
}
@@ -114,11 +114,11 @@ class ClassCollectionLoader
REGEX;
$dontInlineRegex = str_replace('.', $spacesRegex, $dontInlineRegex);
$cacheDir = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $cacheDir));
$cacheDir = explode('/', str_replace(\DIRECTORY_SEPARATOR, '/', $cacheDir));
$files = array();
$content = '';
foreach (self::getOrderedClasses($classes) as $class) {
if (in_array($class->getName(), $declared)) {
if (\in_array($class->getName(), $declared)) {
continue;
}
@@ -126,7 +126,7 @@ REGEX;
$c = file_get_contents($file);
if (preg_match($dontInlineRegex, $c)) {
$file = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $file));
$file = explode('/', str_replace(\DIRECTORY_SEPARATOR, '/', $file));
for ($i = 0; isset($file[$i], $cacheDir[$i]); ++$i) {
if ($file[$i] !== $cacheDir[$i]) {
@@ -136,8 +136,8 @@ REGEX;
if (1 >= $i) {
$file = var_export(implode('/', $file), true);
} else {
$file = array_slice($file, $i);
$file = str_repeat('../', count($cacheDir) - $i).implode('/', $file);
$file = \array_slice($file, $i);
$file = str_repeat('../', \count($cacheDir) - $i).implode('/', $file);
$file = '__DIR__.'.var_export('/'.$file, true);
}
@@ -173,7 +173,7 @@ REGEX;
*/
public static function fixNamespaceDeclarations($source)
{
if (!function_exists('token_get_all') || !self::$useTokenizer) {
if (!\function_exists('token_get_all') || !self::$useTokenizer) {
if (preg_match('/(^|\s)namespace(.*?)\s*;/', $source)) {
$source = preg_replace('/(^|\s)namespace(.*?)\s*;/', "$1namespace$2\n{", $source)."}\n";
}
@@ -190,7 +190,7 @@ REGEX;
$token = $tokens[$i];
if (!isset($token[1]) || 'b"' === $token) {
$rawChunk .= $token;
} elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
} elseif (\in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
// strip comments
continue;
} elseif (T_NAMESPACE === $token[0]) {
@@ -200,7 +200,7 @@ REGEX;
$rawChunk .= $token[1];
// namespace name and whitespaces
while (isset($tokens[++$i][1]) && in_array($tokens[$i][0], array(T_WHITESPACE, T_NS_SEPARATOR, T_STRING))) {
while (isset($tokens[++$i][1]) && \in_array($tokens[$i][0], array(T_WHITESPACE, T_NS_SEPARATOR, T_STRING))) {
$rawChunk .= $tokens[$i][1];
}
if ('{' === $tokens[$i]) {
@@ -275,7 +275,7 @@ REGEX;
*/
private static function writeCacheFile($file, $content)
{
$dir = dirname($file);
$dir = \dirname($file);
if (!is_writable($dir)) {
throw new \RuntimeException(sprintf('Cache directory "%s" is not writable.', $dir));
}

View File

@@ -91,12 +91,12 @@ class ClassLoader
return;
}
if (isset($this->prefixes[$prefix])) {
if (is_array($paths)) {
if (\is_array($paths)) {
$this->prefixes[$prefix] = array_unique(array_merge(
$this->prefixes[$prefix],
$paths
));
} elseif (!in_array($paths, $this->prefixes[$prefix])) {
} elseif (!\in_array($paths, $this->prefixes[$prefix])) {
$this->prefixes[$prefix][] = $paths;
}
} else {
@@ -170,7 +170,7 @@ class ClassLoader
{
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
$classPath = str_replace('\\', \DIRECTORY_SEPARATOR, substr($class, 0, $pos)).\DIRECTORY_SEPARATOR;
$className = substr($class, $pos + 1);
} else {
// PEAR-like class name
@@ -178,21 +178,21 @@ class ClassLoader
$className = $class;
}
$classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';
$classPath .= str_replace('_', \DIRECTORY_SEPARATOR, $className).'.php';
foreach ($this->prefixes as $prefix => $dirs) {
if ($class === strstr($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
return $dir.DIRECTORY_SEPARATOR.$classPath;
if (file_exists($dir.\DIRECTORY_SEPARATOR.$classPath)) {
return $dir.\DIRECTORY_SEPARATOR.$classPath;
}
}
}
}
foreach ($this->fallbackDirs as $dir) {
if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
return $dir.DIRECTORY_SEPARATOR.$classPath;
if (file_exists($dir.\DIRECTORY_SEPARATOR.$classPath)) {
return $dir.\DIRECTORY_SEPARATOR.$classPath;
}
}

View File

@@ -11,11 +11,11 @@
namespace Symfony\Component\ClassLoader;
if (!defined('SYMFONY_TRAIT')) {
if (!\defined('SYMFONY_TRAIT')) {
if (\PHP_VERSION_ID >= 50400) {
define('SYMFONY_TRAIT', T_TRAIT);
\define('SYMFONY_TRAIT', T_TRAIT);
} else {
define('SYMFONY_TRAIT', 0);
\define('SYMFONY_TRAIT', 0);
}
}
@@ -53,7 +53,7 @@ class ClassMapGenerator
*/
public static function createMap($dir)
{
if (is_string($dir)) {
if (\is_string($dir)) {
$dir = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir));
}
@@ -114,7 +114,7 @@ class ClassMapGenerator
$namespace = '';
// If there is a namespace, extract it
while (isset($tokens[++$i][1])) {
if (in_array($tokens[$i][0], array(T_STRING, T_NS_SEPARATOR))) {
if (\in_array($tokens[$i][0], array(T_STRING, T_NS_SEPARATOR))) {
$namespace .= $tokens[$i][1];
}
}
@@ -133,7 +133,7 @@ class ClassMapGenerator
if (T_DOUBLE_COLON === $tokens[$j][0]) {
$isClassConstant = true;
break;
} elseif (!in_array($tokens[$j][0], array(T_WHITESPACE, T_DOC_COMMENT, T_COMMENT))) {
} elseif (!\in_array($tokens[$j][0], array(T_WHITESPACE, T_DOC_COMMENT, T_COMMENT))) {
break;
}
}

View File

@@ -53,7 +53,7 @@ class DebugClassLoader
*/
public static function enable()
{
if (!is_array($functions = spl_autoload_functions())) {
if (!\is_array($functions = spl_autoload_functions())) {
return;
}
@@ -62,7 +62,7 @@ class DebugClassLoader
}
foreach ($functions as $function) {
if (is_array($function) && !$function[0] instanceof self && method_exists($function[0], 'findFile')) {
if (\is_array($function) && !$function[0] instanceof self && method_exists($function[0], 'findFile')) {
$function = array(new static($function[0]), 'loadClass');
}
@@ -104,7 +104,7 @@ class DebugClassLoader
if ($file = $this->classFinder->findFile($class)) {
require $file;
if (!class_exists($class, false) && !interface_exists($class, false) && (!function_exists('trait_exists') || !trait_exists($class, false))) {
if (!class_exists($class, false) && !interface_exists($class, false) && (!\function_exists('trait_exists') || !trait_exists($class, false))) {
if (false !== strpos($class, '/')) {
throw new \RuntimeException(sprintf('Trying to autoload a class with an invalid name "%s". Be careful that the namespace separator is "\" in PHP, not "/".', $class));
}

View File

@@ -28,7 +28,7 @@ class DebugUniversalClassLoader extends UniversalClassLoader
*/
public static function enable()
{
if (!is_array($functions = spl_autoload_functions())) {
if (!\is_array($functions = spl_autoload_functions())) {
return;
}
@@ -37,7 +37,7 @@ class DebugUniversalClassLoader extends UniversalClassLoader
}
foreach ($functions as $function) {
if (is_array($function) && $function[0] instanceof UniversalClassLoader) {
if (\is_array($function) && $function[0] instanceof UniversalClassLoader) {
$loader = new static();
$loader->registerNamespaceFallbacks($function[0]->getNamespaceFallbacks());
$loader->registerPrefixFallbacks($function[0]->getPrefixFallbacks());
@@ -60,7 +60,7 @@ class DebugUniversalClassLoader extends UniversalClassLoader
if ($file = $this->findFile($class)) {
require $file;
if (!class_exists($class, false) && !interface_exists($class, false) && (!function_exists('trait_exists') || !trait_exists($class, false))) {
if (!class_exists($class, false) && !interface_exists($class, false) && (!\function_exists('trait_exists') || !trait_exists($class, false))) {
throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file));
}
}

View File

@@ -29,7 +29,7 @@ class Psr4ClassLoader
public function addPrefix($prefix, $baseDir)
{
$prefix = trim($prefix, '\\').'\\';
$baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
$baseDir = rtrim($baseDir, \DIRECTORY_SEPARATOR).\DIRECTORY_SEPARATOR;
$this->prefixes[] = array($prefix, $baseDir);
}
@@ -45,8 +45,8 @@ class Psr4ClassLoader
foreach ($this->prefixes as $current) {
list($currentPrefix, $currentBaseDir) = $current;
if (0 === strpos($class, $currentPrefix)) {
$classWithoutPrefix = substr($class, strlen($currentPrefix));
$file = $currentBaseDir.str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php';
$classWithoutPrefix = substr($class, \strlen($currentPrefix));
$file = $currentBaseDir.str_replace('\\', \DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php';
if (file_exists($file)) {
return $file;
}

View File

@@ -19,7 +19,7 @@ class ApcClassLoaderTest extends TestCase
{
protected function setUp()
{
if (!(ini_get('apc.enabled') && ini_get('apc.enable_cli'))) {
if (!(filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) && filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN))) {
$this->markTestSkipped('The apc extension is not enabled.');
} else {
apcu_clear_cache();
@@ -28,7 +28,7 @@ class ApcClassLoaderTest extends TestCase
protected function tearDown()
{
if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) {
if (filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) && filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
apcu_clear_cache();
}
}
@@ -36,7 +36,7 @@ class ApcClassLoaderTest extends TestCase
public function testConstructor()
{
$loader = new ClassLoader();
$loader->addPrefix('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Apc\Namespaced', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader = new ApcClassLoader('test.prefix.', $loader);
@@ -49,8 +49,8 @@ class ApcClassLoaderTest extends TestCase
public function testLoadClass($className, $testClassName, $message)
{
$loader = new ClassLoader();
$loader->addPrefix('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Apc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Apc\Namespaced', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Apc_Pearlike_', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader = new ApcClassLoader('test.prefix.', $loader);
$loader->loadClass($testClassName);
@@ -71,9 +71,9 @@ class ApcClassLoaderTest extends TestCase
public function testLoadClassFromFallback($className, $testClassName, $message)
{
$loader = new ClassLoader();
$loader->addPrefix('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Apc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('', array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/fallback'));
$loader->addPrefix('Apc\Namespaced', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Apc_Pearlike_', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('', array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/fallback'));
$loader = new ApcClassLoader('test.prefix.fallback', $loader);
$loader->loadClass($testClassName);
@@ -110,32 +110,32 @@ class ApcClassLoaderTest extends TestCase
return array(
array(
array(
'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
'Apc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
'Apc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
),
'Apc\NamespaceCollision\A\Foo',
'->loadClass() loads NamespaceCollision\A\Foo from alpha.',
),
array(
array(
'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
'Apc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
'Apc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
),
'Apc\NamespaceCollision\A\Bar',
'->loadClass() loads NamespaceCollision\A\Bar from alpha.',
),
array(
array(
'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
'Apc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
'Apc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
),
'Apc\NamespaceCollision\A\B\Foo',
'->loadClass() loads NamespaceCollision\A\B\Foo from beta.',
),
array(
array(
'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
'Apc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
'Apc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
),
'Apc\NamespaceCollision\A\B\Bar',
'->loadClass() loads NamespaceCollision\A\B\Bar from beta.',
@@ -162,32 +162,32 @@ class ApcClassLoaderTest extends TestCase
return array(
array(
array(
'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
'ApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
'ApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
),
'ApcPrefixCollision_A_Foo',
'->loadClass() loads ApcPrefixCollision_A_Foo from alpha.',
),
array(
array(
'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
'ApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
'ApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
),
'ApcPrefixCollision_A_Bar',
'->loadClass() loads ApcPrefixCollision_A_Bar from alpha.',
),
array(
array(
'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
'ApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
'ApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
),
'ApcPrefixCollision_A_B_Foo',
'->loadClass() loads ApcPrefixCollision_A_B_Foo from beta.',
),
array(
array(
'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
'ApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
'ApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
),
'ApcPrefixCollision_A_B_Bar',
'->loadClass() loads ApcPrefixCollision_A_B_Bar from beta.',

View File

@@ -233,7 +233,7 @@ class ClassCollectionLoaderTest extends TestCase
}
});
$strictTypes = defined('HHVM_VERSION') ? '' : "\nnamespace {require __DIR__.'/Fixtures/Namespaced/WithStrictTypes.php';}";
$strictTypes = \defined('HHVM_VERSION') ? '' : "\nnamespace {require __DIR__.'/Fixtures/Namespaced/WithStrictTypes.php';}";
ClassCollectionLoader::load(
array('Namespaced\\WithComments', 'Pearlike_WithComments', 'Namespaced\\WithDirMagic', 'Namespaced\\WithFileMagic', 'Namespaced\\WithHaltCompiler', $strictTypes ? 'Namespaced\\WithStrictTypes' : 'Namespaced\\WithComments'),

View File

@@ -19,9 +19,9 @@ class ClassLoaderTest extends TestCase
public function testGetPrefixes()
{
$loader = new ClassLoader();
$loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Bar', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Bas', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Foo', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Bar', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Bas', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$prefixes = $loader->getPrefixes();
$this->assertArrayHasKey('Foo', $prefixes);
$this->assertArrayNotHasKey('Foo1', $prefixes);
@@ -32,8 +32,8 @@ class ClassLoaderTest extends TestCase
public function testGetFallbackDirs()
{
$loader = new ClassLoader();
$loader->addPrefix(null, __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix(null, __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix(null, __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix(null, __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$fallback_dirs = $loader->getFallbackDirs();
$this->assertCount(2, $fallback_dirs);
}
@@ -44,8 +44,8 @@ class ClassLoaderTest extends TestCase
public function testLoadClass($className, $testClassName, $message)
{
$loader = new ClassLoader();
$loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Namespaced2\\', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Pearlike2_', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->loadClass($testClassName);
$this->assertTrue(class_exists($className), $message);
}
@@ -64,8 +64,8 @@ class ClassLoaderTest extends TestCase
public function testLoadNonexistentClass($className, $testClassName, $message)
{
$loader = new ClassLoader();
$loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Namespaced2\\', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Pearlike2_', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->loadClass($testClassName);
$this->assertFalse(class_exists($className), $message);
}
@@ -80,8 +80,8 @@ class ClassLoaderTest extends TestCase
public function testAddPrefixSingle()
{
$loader = new ClassLoader();
$loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Foo', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Foo', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$prefixes = $loader->getPrefixes();
$this->assertArrayHasKey('Foo', $prefixes);
$this->assertCount(1, $prefixes['Foo']);
@@ -123,7 +123,7 @@ class ClassLoaderTest extends TestCase
set_include_path(__DIR__.'/Fixtures/includepath'.PATH_SEPARATOR.$includePath);
$this->assertEquals(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'includepath'.DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo'));
$this->assertEquals(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR.'includepath'.\DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo'));
set_include_path($includePath);
}
@@ -134,9 +134,9 @@ class ClassLoaderTest extends TestCase
public function testLoadClassFromFallback($className, $testClassName, $message)
{
$loader = new ClassLoader();
$loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('', array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback'));
$loader->addPrefix('Namespaced2\\', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Pearlike2_', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('', array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/fallback'));
$loader->loadClass($testClassName);
$this->assertTrue(class_exists($className), $message);
}
@@ -168,64 +168,64 @@ class ClassLoaderTest extends TestCase
return array(
array(
array(
'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\C' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\C\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
),
'NamespaceCollision\C\Foo',
'->loadClass() loads NamespaceCollision\C\Foo from alpha.',
),
array(
array(
'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\C\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\C' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
),
'NamespaceCollision\C\Bar',
'->loadClass() loads NamespaceCollision\C\Bar from alpha.',
),
array(
array(
'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\C' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\C\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
),
'NamespaceCollision\C\B\Foo',
'->loadClass() loads NamespaceCollision\C\B\Foo from beta.',
),
array(
array(
'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\C\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\C' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
),
'NamespaceCollision\C\B\Bar',
'->loadClass() loads NamespaceCollision\C\B\Bar from beta.',
),
array(
array(
'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_C_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_C_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
),
'PrefixCollision_C_Foo',
'->loadClass() loads PrefixCollision_C_Foo from alpha.',
),
array(
array(
'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_C_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_C_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
),
'PrefixCollision_C_Bar',
'->loadClass() loads PrefixCollision_C_Bar from alpha.',
),
array(
array(
'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_C_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_C_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
),
'PrefixCollision_C_B_Foo',
'->loadClass() loads PrefixCollision_C_B_Foo from beta.',
),
array(
array(
'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_C_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_C_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
),
'PrefixCollision_C_B_Bar',
'->loadClass() loads PrefixCollision_C_B_Bar from beta.',

View File

@@ -21,7 +21,7 @@ class LegacyApcUniversalClassLoaderTest extends TestCase
{
protected function setUp()
{
if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) {
if (filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) && filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
apcu_clear_cache();
} else {
$this->markTestSkipped('APC is not enabled.');
@@ -30,7 +30,7 @@ class LegacyApcUniversalClassLoaderTest extends TestCase
protected function tearDown()
{
if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) {
if (filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) && filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
apcu_clear_cache();
}
}
@@ -38,7 +38,7 @@ class LegacyApcUniversalClassLoaderTest extends TestCase
public function testConstructor()
{
$loader = new ApcUniversalClassLoader('test.prefix.');
$loader->registerNamespace('LegacyApc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespace('LegacyApc\Namespaced', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$this->assertEquals($loader->findFile('\LegacyApc\Namespaced\FooBar'), apcu_fetch('test.prefix.\LegacyApc\Namespaced\FooBar'), '__construct() takes a prefix as its first argument');
}
@@ -49,8 +49,8 @@ class LegacyApcUniversalClassLoaderTest extends TestCase
public function testLoadClass($className, $testClassName, $message)
{
$loader = new ApcUniversalClassLoader('test.prefix.');
$loader->registerNamespace('LegacyApc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('LegacyApc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespace('LegacyApc\Namespaced', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('LegacyApc_Pearlike_', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->loadClass($testClassName);
$this->assertTrue(class_exists($className), $message);
}
@@ -69,10 +69,10 @@ class LegacyApcUniversalClassLoaderTest extends TestCase
public function testLoadClassFromFallback($className, $testClassName, $message)
{
$loader = new ApcUniversalClassLoader('test.prefix.fallback');
$loader->registerNamespace('LegacyApc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('LegacyApc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespaceFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/fallback'));
$loader->registerPrefixFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/fallback'));
$loader->registerNamespace('LegacyApc\Namespaced', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('LegacyApc_Pearlike_', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespaceFallbacks(array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/fallback'));
$loader->registerPrefixFallbacks(array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/fallback'));
$loader->loadClass($testClassName);
$this->assertTrue(class_exists($className), $message);
}
@@ -105,32 +105,32 @@ class LegacyApcUniversalClassLoaderTest extends TestCase
return array(
array(
array(
'LegacyApc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha',
'LegacyApc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta',
'LegacyApc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha',
'LegacyApc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta',
),
'LegacyApc\NamespaceCollision\A\Foo',
'->loadClass() loads NamespaceCollision\A\Foo from alpha.',
),
array(
array(
'LegacyApc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta',
'LegacyApc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha',
'LegacyApc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta',
'LegacyApc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha',
),
'LegacyApc\NamespaceCollision\A\Bar',
'->loadClass() loads NamespaceCollision\A\Bar from alpha.',
),
array(
array(
'LegacyApc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha',
'LegacyApc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta',
'LegacyApc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha',
'LegacyApc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta',
),
'LegacyApc\NamespaceCollision\A\B\Foo',
'->loadClass() loads NamespaceCollision\A\B\Foo from beta.',
),
array(
array(
'LegacyApc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta',
'LegacyApc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha',
'LegacyApc\\NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta',
'LegacyApc\\NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha',
),
'LegacyApc\NamespaceCollision\A\B\Bar',
'->loadClass() loads NamespaceCollision\A\B\Bar from beta.',
@@ -155,32 +155,32 @@ class LegacyApcUniversalClassLoaderTest extends TestCase
return array(
array(
array(
'LegacyApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha/LegacyApc',
'LegacyApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta/LegacyApc',
'LegacyApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha/LegacyApc',
'LegacyApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta/LegacyApc',
),
'LegacyApcPrefixCollision_A_Foo',
'->loadClass() loads LegacyApcPrefixCollision_A_Foo from alpha.',
),
array(
array(
'LegacyApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta/LegacyApc',
'LegacyApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha/LegacyApc',
'LegacyApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta/LegacyApc',
'LegacyApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha/LegacyApc',
),
'LegacyApcPrefixCollision_A_Bar',
'->loadClass() loads LegacyApcPrefixCollision_A_Bar from alpha.',
),
array(
array(
'LegacyApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha/LegacyApc',
'LegacyApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta/LegacyApc',
'LegacyApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha/LegacyApc',
'LegacyApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta/LegacyApc',
),
'LegacyApcPrefixCollision_A_B_Foo',
'->loadClass() loads LegacyApcPrefixCollision_A_B_Foo from beta.',
),
array(
array(
'LegacyApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta/LegacyApc',
'LegacyApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha/LegacyApc',
'LegacyApcPrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/beta/LegacyApc',
'LegacyApcPrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/LegacyApc/alpha/LegacyApc',
),
'LegacyApcPrefixCollision_A_B_Bar',
'->loadClass() loads LegacyApcPrefixCollision_A_B_Bar from beta.',

View File

@@ -25,8 +25,8 @@ class LegacyUniversalClassLoaderTest extends TestCase
public function testLoadClass($className, $testClassName, $message)
{
$loader = new UniversalClassLoader();
$loader->registerNamespace('Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespace('Namespaced', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('Pearlike_', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$this->assertTrue($loader->loadClass($testClassName));
$this->assertTrue(class_exists($className), $message);
}
@@ -53,7 +53,7 @@ class LegacyUniversalClassLoaderTest extends TestCase
set_include_path(__DIR__.'/Fixtures/includepath'.PATH_SEPARATOR.$includePath);
$this->assertEquals(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'includepath'.DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo'));
$this->assertEquals(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR.'includepath'.\DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo'));
set_include_path($includePath);
}
@@ -61,9 +61,9 @@ class LegacyUniversalClassLoaderTest extends TestCase
public function testGetNamespaces()
{
$loader = new UniversalClassLoader();
$loader->registerNamespace('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespace('Bar', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespace('Bas', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespace('Foo', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespace('Bar', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespace('Bas', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$namespaces = $loader->getNamespaces();
$this->assertArrayHasKey('Foo', $namespaces);
$this->assertArrayNotHasKey('Foo1', $namespaces);
@@ -74,9 +74,9 @@ class LegacyUniversalClassLoaderTest extends TestCase
public function testGetPrefixes()
{
$loader = new UniversalClassLoader();
$loader->registerPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('Bar', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('Bas', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('Foo', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('Bar', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('Bas', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$prefixes = $loader->getPrefixes();
$this->assertArrayHasKey('Foo', $prefixes);
$this->assertArrayNotHasKey('Foo1', $prefixes);
@@ -90,10 +90,10 @@ class LegacyUniversalClassLoaderTest extends TestCase
public function testLoadClassFromFallback($className, $testClassName, $message)
{
$loader = new UniversalClassLoader();
$loader->registerNamespace('Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespaceFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback'));
$loader->registerPrefixFallbacks(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback'));
$loader->registerNamespace('Namespaced', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('Pearlike_', __DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespaceFallbacks(array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/fallback'));
$loader->registerPrefixFallbacks(array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/fallback'));
$this->assertTrue($loader->loadClass($testClassName));
$this->assertTrue(class_exists($className), $message);
}
@@ -111,15 +111,15 @@ class LegacyUniversalClassLoaderTest extends TestCase
public function testRegisterPrefixFallback()
{
$loader = new UniversalClassLoader();
$loader->registerPrefixFallback(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback');
$this->assertEquals(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback'), $loader->getPrefixFallbacks());
$loader->registerPrefixFallback(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/fallback');
$this->assertEquals(array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/fallback'), $loader->getPrefixFallbacks());
}
public function testRegisterNamespaceFallback()
{
$loader = new UniversalClassLoader();
$loader->registerNamespaceFallback(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Namespaced/fallback');
$this->assertEquals(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Namespaced/fallback'), $loader->getNamespaceFallbacks());
$loader->registerNamespaceFallback(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Namespaced/fallback');
$this->assertEquals(array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures/Namespaced/fallback'), $loader->getNamespaceFallbacks());
}
/**
@@ -139,32 +139,32 @@ class LegacyUniversalClassLoaderTest extends TestCase
return array(
array(
array(
'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
),
'NamespaceCollision\A\Foo',
'->loadClass() loads NamespaceCollision\A\Foo from alpha.',
),
array(
array(
'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
),
'NamespaceCollision\A\Bar',
'->loadClass() loads NamespaceCollision\A\Bar from alpha.',
),
array(
array(
'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
),
'NamespaceCollision\A\B\Foo',
'->loadClass() loads NamespaceCollision\A\B\Foo from beta.',
),
array(
array(
'NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'NamespaceCollision\\A\\B' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
'NamespaceCollision\\A' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
),
'NamespaceCollision\A\B\Bar',
'->loadClass() loads NamespaceCollision\A\B\Bar from beta.',
@@ -189,32 +189,32 @@ class LegacyUniversalClassLoaderTest extends TestCase
return array(
array(
array(
'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
),
'PrefixCollision_A_Foo',
'->loadClass() loads PrefixCollision_A_Foo from alpha.',
),
array(
array(
'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
),
'PrefixCollision_A_Bar',
'->loadClass() loads PrefixCollision_A_Bar from alpha.',
),
array(
array(
'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
),
'PrefixCollision_A_B_Foo',
'->loadClass() loads PrefixCollision_A_B_Foo from beta.',
),
array(
array(
'PrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
'PrefixCollision_A_B_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/beta',
'PrefixCollision_A_' => __DIR__.\DIRECTORY_SEPARATOR.'Fixtures/alpha',
),
'PrefixCollision_A_B_Bar',
'->loadClass() loads PrefixCollision_A_B_Bar from beta.',

View File

@@ -25,7 +25,7 @@ class Psr4ClassLoaderTest extends TestCase
$loader = new Psr4ClassLoader();
$loader->addPrefix(
'Acme\\DemoLib',
__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'psr-4'
__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR.'psr-4'
);
$loader->loadClass($className);
$this->assertTrue(class_exists($className), sprintf('loadClass() should load %s', $className));
@@ -53,7 +53,7 @@ class Psr4ClassLoaderTest extends TestCase
$loader = new Psr4ClassLoader();
$loader->addPrefix(
'Acme\\DemoLib',
__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'psr-4'
__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR.'psr-4'
);
$loader->loadClass($className);
$this->assertFalse(class_exists($className), sprintf('loadClass() should not load %s', $className));

View File

@@ -256,14 +256,14 @@ class UniversalClassLoader
// namespaced class name
$namespace = substr($class, 0, $pos);
$className = substr($class, $pos + 1);
$normalizedClass = str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';
$normalizedClass = str_replace('\\', \DIRECTORY_SEPARATOR, $namespace).\DIRECTORY_SEPARATOR.str_replace('_', \DIRECTORY_SEPARATOR, $className).'.php';
foreach ($this->namespaces as $ns => $dirs) {
if (0 !== strpos($namespace, $ns)) {
continue;
}
foreach ($dirs as $dir) {
$file = $dir.DIRECTORY_SEPARATOR.$normalizedClass;
$file = $dir.\DIRECTORY_SEPARATOR.$normalizedClass;
if (is_file($file)) {
return $file;
}
@@ -271,21 +271,21 @@ class UniversalClassLoader
}
foreach ($this->namespaceFallbacks as $dir) {
$file = $dir.DIRECTORY_SEPARATOR.$normalizedClass;
$file = $dir.\DIRECTORY_SEPARATOR.$normalizedClass;
if (is_file($file)) {
return $file;
}
}
} else {
// PEAR-like class name
$normalizedClass = str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
$normalizedClass = str_replace('_', \DIRECTORY_SEPARATOR, $class).'.php';
foreach ($this->prefixes as $prefix => $dirs) {
if (0 !== strpos($class, $prefix)) {
continue;
}
foreach ($dirs as $dir) {
$file = $dir.DIRECTORY_SEPARATOR.$normalizedClass;
$file = $dir.\DIRECTORY_SEPARATOR.$normalizedClass;
if (is_file($file)) {
return $file;
}
@@ -293,7 +293,7 @@ class UniversalClassLoader
}
foreach ($this->prefixFallbacks as $dir) {
$file = $dir.DIRECTORY_SEPARATOR.$normalizedClass;
$file = $dir.\DIRECTORY_SEPARATOR.$normalizedClass;
if (is_file($file)) {
return $file;
}

View File

@@ -66,7 +66,7 @@ class WinCacheClassLoader
*/
public function __construct($prefix, $decorated)
{
if (!extension_loaded('wincache')) {
if (!\extension_loaded('wincache')) {
throw new \RuntimeException('Unable to use WinCacheClassLoader as WinCache is not enabled.');
}
@@ -135,6 +135,6 @@ class WinCacheClassLoader
*/
public function __call($method, $args)
{
return call_user_func_array(array($this->decorated, $method), $args);
return \call_user_func_array(array($this->decorated, $method), $args);
}
}

View File

@@ -60,7 +60,7 @@ class XcacheClassLoader
*/
public function __construct($prefix, $decorated)
{
if (!extension_loaded('xcache')) {
if (!\extension_loaded('xcache')) {
throw new \RuntimeException('Unable to use XcacheClassLoader as XCache is not enabled.');
}
@@ -130,6 +130,6 @@ class XcacheClassLoader
*/
public function __call($method, $args)
{
return call_user_func_array(array($this->decorated, $method), $args);
return \call_user_func_array(array($this->decorated, $method), $args);
}
}

View File

@@ -21,7 +21,7 @@
"symfony/polyfill-apcu": "~1.1"
},
"require-dev": {
"symfony/finder": "^2.0.5"
"symfony/finder": "^2.0.5|~3.0.0"
},
"autoload": {
"psr-4": { "Symfony\\Component\\ClassLoader\\": "" },
@@ -31,7 +31,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"