Merge branch '3.4' into 4.0

* 3.4:
  [travis] fix php-ext/ location
  throw exception if docblock factory does not exist
This commit is contained in:
Nicolas Grekas 2018-02-22 13:30:04 +01:00
commit cffa7be92f
3 changed files with 9 additions and 5 deletions

View File

@ -103,7 +103,7 @@ before_install:
local ext_name=$1
local ext_so=$2
local ext_dir=$(php -r "echo ini_get('extension_dir');")
local ext_cache=~/php-ext/$(basename $ext_dir)/$ext_name
local ext_cache=php-ext/$(basename $ext_dir)/$ext_name
if [[ -e $ext_cache/$ext_so ]]; then
echo extension = $ext_cache/$ext_so >> $INI
@ -134,7 +134,7 @@ before_install:
# Install extra PHP extensions
if [[ ! $skip ]]; then
# install libsodium
if [[ ! -e ~/php-ext/$(php -r "echo basename(ini_get('extension_dir'));")/libsodium/sodium.so ]]; then
if [[ ! -e php-ext/$(php -r "echo basename(ini_get('extension_dir'));")/libsodium/sodium.so ]]; then
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -q
sudo apt-get install libsodium-dev -y

View File

@ -53,6 +53,10 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property
*/
public function __construct(DocBlockFactoryInterface $docBlockFactory = null, array $mutatorPrefixes = null, array $accessorPrefixes = null, array $arrayMutatorPrefixes = null)
{
if (!class_exists(DocBlockFactory::class)) {
throw new \RuntimeException(sprintf('Unable to use the "%s" class as the "phpdocumentor/reflection-docblock" package is not installed.', __CLASS__));
}
$this->docBlockFactory = $docBlockFactory ?: DocBlockFactory::createInstance();
$this->contextFactory = new ContextFactory();
$this->phpDocTypeHelper = new PhpDocTypeHelper();