From d3b1bf571bf01bc85d4f6b2732c70d2a44647e10 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 4 Dec 2014 13:37:59 +0100 Subject: [PATCH 1/3] #1200 - removing `Yaml::parse()` deprecation errors by passing in file contents instead of file paths --- lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php | 2 +- lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php index c492c0f54..cf1dc5bc0 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -788,6 +788,6 @@ class YamlDriver extends FileDriver */ protected function loadMappingFile($file) { - return Yaml::parse($file); + return Yaml::parse(file_get_contents($file)); } } diff --git a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php index 540945388..8003000ce 100644 --- a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php +++ b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php @@ -77,10 +77,10 @@ class ConvertDoctrine1Schema if (is_dir($path)) { $files = glob($path . '/*.yml'); foreach ($files as $file) { - $schema = array_merge($schema, (array) Yaml::parse($file)); + $schema = array_merge($schema, (array) Yaml::parse(file_get_contents($file))); } } else { - $schema = array_merge($schema, (array) Yaml::parse($path)); + $schema = array_merge($schema, (array) Yaml::parse(file_get_contents($file))); } } From 9d2c0481aeab512c36fa608b4fb1d8ad37efde4d Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 4 Dec 2014 13:40:22 +0100 Subject: [PATCH 2/3] #1200 - removing console deprecation errors by using the new `Symfony\Component\Console\Helper\Table` instead of the deprecated `TableHelper` --- .../ORM/Tools/Console/Command/MappingDescribeCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php index 47a00b996..ab7ea5577 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php @@ -22,7 +22,7 @@ namespace Doctrine\ORM\Tools\Console\Command; use Doctrine\Common\Persistence\Mapping\MappingException; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\TableHelper; +use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -79,7 +79,7 @@ EOT */ private function displayEntity($entityName, EntityManagerInterface $entityManager, OutputInterface $output) { - $table = new TableHelper(); + $table = new Table($output); $table->setHeaders(array('Field', 'Value')); @@ -126,7 +126,7 @@ EOT ) ); - $table->render($output); + $table->render(); } /** From 351707f1f1d1c054ce6edc91d29ec4b71689fee7 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 4 Dec 2014 13:42:38 +0100 Subject: [PATCH 3/3] #1200 - bumping `symfony/console` dependency to `~2.5` because of the `Symfony\Component\Console\Helper\Table` not being available in < 2.5 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6a26d79a0..80dc114f0 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "doctrine/collections": "~1.2", "doctrine/dbal": ">=2.5-dev,<2.6-dev", "doctrine/instantiator": "~1.0.1", - "symfony/console": "~2.3" + "symfony/console": "~2.5" }, "require-dev": { "symfony/yaml": "~2.1",