From edde7a45adfdb74ec3a5829ff338e12eb0537f05 Mon Sep 17 00:00:00 2001 From: Maks3w Date: Mon, 9 Jul 2012 16:19:42 +0200 Subject: [PATCH 1/4] [CS][Library] Set File Header http://framework.zend.com/wiki/display/ZFDEV2/Coding+Standards#CodingStandards-Files The following script replaces the content between PHP open tag and namespace declaration. for COMPONENT in $(ls -d *) do for FILE in $(find $COMPONENT -name "*.php") do BLOCK="\/\*\*\n \* Zend Framework \(http:\/\/framework\.zend\.com\/\)\n \*\n \* \@link http:\/\/github\.com\/zendframework\/zf2 for the canonical source repository\n \* \@copyright Copyright \(c\) 2005-2012 Zend Technologies USA Inc\. \(http:\/\/www\.zend\.com\)\n \* \@license http:\/\/framework\.zend\.com\/license\/new-bsd New BSD License\n \* \@package Zend_$COMPONENT\n \*\/" perl -0777 -i -pe "s/(<\?php(\s*.*)*\nn)/ Date: Mon, 9 Jul 2012 16:34:21 +0200 Subject: [PATCH 2/4] [CS][test] Remove @copyright & @license for fl in $(find . -name "*.php"); do mv $fl $fl.old; sed '/@copyright/d' $fl.old > $fl; rm -f $fl.old; done; for fl in $(find . -name "*.php"); do mv $fl $fl.old; sed '/@license/d' $fl.old > $fl; rm -f $fl.old; done; --- test/ConfigTest.php | 4 ---- test/FactoryTest.php | 4 ---- test/ProcessorTest.php | 4 ---- test/Reader/AbstractReaderTestCase.php | 4 ---- test/Reader/IniTest.php | 4 ---- test/Reader/JsonTest.php | 4 ---- test/Reader/XmlTest.php | 4 ---- test/Reader/YamlTest.php | 4 ---- test/Writer/AbstractWriterTestCase.php | 4 ---- test/Writer/IniTest.php | 4 ---- test/Writer/JsonTest.php | 4 ---- test/Writer/PhpArrayTest.php | 4 ---- test/Writer/XmlTest.php | 4 ---- test/Writer/YamlTest.php | 4 ---- 14 files changed, 56 deletions(-) diff --git a/test/ConfigTest.php b/test/ConfigTest.php index e5ea31c..8969e7d 100644 --- a/test/ConfigTest.php +++ b/test/ConfigTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config; @@ -27,8 +25,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class ConfigTest extends \PHPUnit_Framework_TestCase diff --git a/test/FactoryTest.php b/test/FactoryTest.php index 29f91f9..d34a045 100644 --- a/test/FactoryTest.php +++ b/test/FactoryTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config; @@ -27,8 +25,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class FactoryTest extends \PHPUnit_Framework_TestCase diff --git a/test/ProcessorTest.php b/test/ProcessorTest.php index 196ed07..91cb319 100644 --- a/test/ProcessorTest.php +++ b/test/ProcessorTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config; @@ -37,8 +35,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class ProcessorTest extends \PHPUnit_Framework_TestCase diff --git a/test/Reader/AbstractReaderTestCase.php b/test/Reader/AbstractReaderTestCase.php index 55644b8..d0429c3 100644 --- a/test/Reader/AbstractReaderTestCase.php +++ b/test/Reader/AbstractReaderTestCase.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config\Reader; @@ -29,8 +27,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ abstract class AbstractReaderTestCase extends TestCase diff --git a/test/Reader/IniTest.php b/test/Reader/IniTest.php index f0d5edb..c975c35 100644 --- a/test/Reader/IniTest.php +++ b/test/Reader/IniTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config\Reader; @@ -27,8 +25,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class IniTest extends AbstractReaderTestCase diff --git a/test/Reader/JsonTest.php b/test/Reader/JsonTest.php index 522cdb7..34b9b3b 100644 --- a/test/Reader/JsonTest.php +++ b/test/Reader/JsonTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config\Reader; @@ -27,8 +25,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class JsonTest extends AbstractReaderTestCase diff --git a/test/Reader/XmlTest.php b/test/Reader/XmlTest.php index 556ba6f..c80b333 100644 --- a/test/Reader/XmlTest.php +++ b/test/Reader/XmlTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config\Reader; @@ -27,8 +25,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class XmlTest extends AbstractReaderTestCase diff --git a/test/Reader/YamlTest.php b/test/Reader/YamlTest.php index 0e08d0b..f90d510 100644 --- a/test/Reader/YamlTest.php +++ b/test/Reader/YamlTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config\Reader; @@ -27,8 +25,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class YamlTest extends AbstractReaderTestCase diff --git a/test/Writer/AbstractWriterTestCase.php b/test/Writer/AbstractWriterTestCase.php index 7319703..78eb49c 100644 --- a/test/Writer/AbstractWriterTestCase.php +++ b/test/Writer/AbstractWriterTestCase.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config\Writer; @@ -28,8 +26,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ abstract class AbstractWriterTestCase extends TestCase diff --git a/test/Writer/IniTest.php b/test/Writer/IniTest.php index 94a0401..41dea5e 100644 --- a/test/Writer/IniTest.php +++ b/test/Writer/IniTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config\Writer; @@ -29,8 +27,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class IniTest extends AbstractWriterTestCase diff --git a/test/Writer/JsonTest.php b/test/Writer/JsonTest.php index 44656bc..91887e0 100644 --- a/test/Writer/JsonTest.php +++ b/test/Writer/JsonTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config\Writer; @@ -29,8 +27,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class JsonTest extends AbstractWriterTestCase diff --git a/test/Writer/PhpArrayTest.php b/test/Writer/PhpArrayTest.php index 8caf8e3..b850cd3 100644 --- a/test/Writer/PhpArrayTest.php +++ b/test/Writer/PhpArrayTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config\Writer; @@ -29,8 +27,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class PhpArrayTest extends AbstractWriterTestCase diff --git a/test/Writer/XmlTest.php b/test/Writer/XmlTest.php index ed8ad5a..700fa5c 100644 --- a/test/Writer/XmlTest.php +++ b/test/Writer/XmlTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config\Writer; @@ -29,8 +27,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class XmlTest extends AbstractWriterTestCase diff --git a/test/Writer/YamlTest.php b/test/Writer/YamlTest.php index b21886c..ed71928 100644 --- a/test/Writer/YamlTest.php +++ b/test/Writer/YamlTest.php @@ -15,8 +15,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Config\Writer; @@ -29,8 +27,6 @@ * @category Zend * @package Zend_Config * @subpackage UnitTests - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ class YamlTest extends AbstractWriterTestCase From 391092327935930491946581319038e333d2ca87 Mon Sep 17 00:00:00 2001 From: Maks3w Date: Mon, 9 Jul 2012 16:41:27 +0200 Subject: [PATCH 3/4] [CS][Tests] Set File Header http://framework.zend.com/wiki/display/ZFDEV2/Coding+Standards#CodingStandards-Files The following script replaces the content between PHP open tag and namespace declaration. for COMPONENT in $(ls -d *) do for FILE in $(find $COMPONENT -name "*.php") do BLOCK="\/\*\*\n \* Zend Framework \(http:\/\/framework\.zend\.com\/\)\n \*\n \* \@link http:\/\/github\.com\/zendframework\/zf2 for the canonical source repository\n \* \@copyright Copyright \(c\) 2005-2012 Zend Technologies USA Inc\. \(http:\/\/www\.zend\.com\)\n \* \@license http:\/\/framework\.zend\.com\/license\/new-bsd New BSD License\n \* \@package Zend_$COMPONENT\n \*\/" perl -0777 -i -pe "s/(<\?php(\s*.*)*\nn)/ Date: Mon, 9 Jul 2012 16:46:59 -0500 Subject: [PATCH 4/4] [zen-49] Correct import statements across framework - Ran a script that would create multiple import statements out of multi-line import statements, and which would sort all import statements in alphabetic order. Script is at https://gist.github.com/3079222 and was run by dropping into the library/Zend folder and typing (in zsh) "for file in **/*.php;do php /path/to/replace-uses.php $file; done" --- src/Config.php | 2 +- src/Processor/Queue.php | 2 +- src/Processor/Token.php | 2 +- src/Reader/Json.php | 2 +- src/Writer/AbstractWriter.php | 2 +- src/Writer/Xml.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Config.php b/src/Config.php index 70fa03a..ece2b09 100644 --- a/src/Config.php +++ b/src/Config.php @@ -10,9 +10,9 @@ namespace Zend\Config; +use ArrayAccess; use Countable; use Iterator; -use ArrayAccess; use Zend\Stdlib\ArrayUtils; /** diff --git a/src/Processor/Queue.php b/src/Processor/Queue.php index e369149..fb276ba 100644 --- a/src/Processor/Queue.php +++ b/src/Processor/Queue.php @@ -11,8 +11,8 @@ namespace Zend\Config\Processor; use Zend\Config\Config; -use Zend\Stdlib\PriorityQueue; use Zend\Config\Exception; +use Zend\Stdlib\PriorityQueue; /** * @category Zend diff --git a/src/Processor/Token.php b/src/Processor/Token.php index cf725ba..022daf5 100644 --- a/src/Processor/Token.php +++ b/src/Processor/Token.php @@ -10,9 +10,9 @@ namespace Zend\Config\Processor; +use Traversable; use Zend\Config\Config; use Zend\Config\Exception; -use Traversable; /** * @category Zend diff --git a/src/Reader/Json.php b/src/Reader/Json.php index 01a5f9e..a84b7e4 100644 --- a/src/Reader/Json.php +++ b/src/Reader/Json.php @@ -11,8 +11,8 @@ namespace Zend\Config\Reader; use Zend\Config\Exception; -use Zend\Json\Json as JsonFormat; use Zend\Json\Exception as JsonException; +use Zend\Json\Json as JsonFormat; /** * JSON config reader. diff --git a/src/Writer/AbstractWriter.php b/src/Writer/AbstractWriter.php index 1d6df80..b2817ec 100644 --- a/src/Writer/AbstractWriter.php +++ b/src/Writer/AbstractWriter.php @@ -11,8 +11,8 @@ namespace Zend\Config\Writer; use Traversable; -use Zend\Config\Exception; use Zend\Config\Config; +use Zend\Config\Exception; use Zend\Stdlib\ArrayUtils; /** diff --git a/src/Writer/Xml.php b/src/Writer/Xml.php index 1e6ec03..c4e0827 100644 --- a/src/Writer/Xml.php +++ b/src/Writer/Xml.php @@ -10,8 +10,8 @@ namespace Zend\Config\Writer; -use Zend\Config\Exception; use XMLWriter; +use Zend\Config\Exception; /** * @category Zend