Completed
Push — scrutinizer ( c2ef4a...84e9d0 )
by Fabio
22:07
created
bin/prado-cli.php 2 patches
Doc Comments   +40 added lines patch added patch discarded remove patch
@@ -145,6 +145,10 @@  discard block
 block discarded – undo
145 145
 	 */
146 146
 	public abstract function performAction($args);
147 147
 
148
+	/**
149
+	 * @param string $dir
150
+	 * @param integer $mask
151
+	 */
148 152
 	protected function createDirectory($dir, $mask)
149 153
 	{
150 154
 		if(!is_dir($dir))
@@ -156,6 +160,9 @@  discard block
 block discarded – undo
156 160
 			chmod($dir, $mask);
157 161
 	}
158 162
 
163
+	/**
164
+	 * @param string $filename
165
+	 */
159 166
 	protected function createFile($filename, $content)
160 167
 	{
161 168
 		if(!is_file($filename))
@@ -304,6 +311,9 @@  discard block
 block discarded – undo
304 311
 ';
305 312
 	}
306 313
 
314
+	/**
315
+	 * @param string $appName
316
+	 */
307 317
 	protected function renderConfigFile($appName)
308 318
 	{
309 319
 		return <<<EOD
@@ -500,6 +510,9 @@  discard block
 block discarded – undo
500 510
 		require_once($TEST_TOOLS.'/simpletest/reporter.php');
501 511
 	}
502 512
 
513
+	/**
514
+	 * @param string $dir
515
+	 */
503 516
 	protected function runUnitTests($dir, $args)
504 517
 	{
505 518
 		$app_dir = $this->getAppDir($dir);
@@ -538,6 +551,9 @@  discard block
 block discarded – undo
538 551
 		return realpath($dir.'/tests/unit/');
539 552
 	}
540 553
 
554
+	/**
555
+	 * @param string $dir
556
+	 */
541 557
 	protected function getUnitTestCases($dir,$args)
542 558
 	{
543 559
 		$matches = null;
@@ -549,6 +565,9 @@  discard block
 block discarded – undo
549 565
 		return $test;
550 566
 	}
551 567
 
568
+	/**
569
+	 * @param GroupTest $test
570
+	 */
552 571
 	protected function addTests($test,$path,$recursive=true,$match=null)
553 572
 	{
554 573
 		$dir=opendir($path);
@@ -565,6 +584,9 @@  discard block
 block discarded – undo
565 584
 		closedir($dir);
566 585
 	}
567 586
 
587
+	/**
588
+	 * @param string $entry
589
+	 */
568 590
 	protected function hasMatch($match,$entry)
569 591
 	{
570 592
 		$file = strtolower(substr($entry,0,strrpos($entry,'.')));
@@ -630,6 +652,9 @@  discard block
 block discarded – undo
630 652
 		return false;
631 653
 	}
632 654
 
655
+	/**
656
+	 * @param string $app_dir
657
+	 */
633 658
 	protected function getActiveRecordConfig($app_dir)
634 659
 	{
635 660
 		if(false === ($xml=$this->getXmlFile($app_dir)))
@@ -645,6 +670,9 @@  discard block
 block discarded – undo
645 670
 		return false;
646 671
 	}
647 672
 
673
+	/**
674
+	 * @param string $app_dir
675
+	 */
648 676
 	protected function getOutputFile($app_dir, $namespace)
649 677
 	{
650 678
 		if(is_file($namespace) && strpos($namespace, $app_dir)===0)
@@ -659,6 +687,9 @@  discard block
 block discarded – undo
659 687
 		return false;
660 688
 	}
661 689
 
690
+	/**
691
+	 * @param TActiveRecordConfig $config
692
+	 */
662 693
 	protected function generateActiveRecord($config, $tablename, $output)
663 694
 	{
664 695
 		$manager = TActiveRecordManager::getInstance();
@@ -706,6 +737,9 @@  discard block
 block discarded – undo
706 737
 		return $prop;
707 738
 	}
708 739
 
740
+	/**
741
+	 * @param string $class
742
+	 */
709 743
 	protected function generateClass($properties, $tablename, $class)
710 744
 	{
711 745
 		$props = implode("\n", $properties);
@@ -799,6 +833,9 @@  discard block
 block discarded – undo
799 833
         return false;
800 834
     }
801 835
 
836
+    /**
837
+     * @param string $app_dir
838
+     */
802 839
     protected function getActiveRecordConfig($app_dir) {
803 840
         if (false === ($xml = $this->getXmlFile($app_dir)))
804 841
             return false;
@@ -842,6 +879,9 @@  discard block
 block discarded – undo
842 879
 			}
843 880
 	    }
844 881
 
882
+	    /**
883
+	     * @param string $l
884
+	     */
845 885
 	    public function generate($l)
846 886
 	    {
847 887
 			$input = explode(" ", trim($l));
Please login to merge, or discard this patch.
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -740,89 +740,89 @@  discard block
 block discarded – undo
740 740
  */
741 741
 class PradoCommandLineActiveRecordGenAll extends PradoCommandLineAction {
742 742
 
743
-    protected $action = 'generateAll';
744
-    protected $parameters = array('output');
745
-    protected $optional = array('directory', 'soap', 'overwrite', 'prefix', 'postfix');
746
-    protected $description = "Generate Active Record skeleton for all Tables to <output> file using application.xml in [directory]. May also generate [soap] properties.\nGenerated Classes are named like the Table with optional [Prefix] and/or [Postfix]. [Overwrite] is used to overwrite existing Files.";
747
-    private $_soap = false;
748
-    private $_prefix = '';
749
-    private $_postfix = '';
750
-    private $_overwrite = false;
751
-
752
-    public function performAction($args) {
753
-        $app_dir = count($args) > 2 ? $this->getAppDir($args[2]) : $this->getAppDir();
754
-        $this->_soap = count($args) > 3 ? ($args[3] == "soap" || $args[3] == "true" ? true : false) : false;
755
-        $this->_overwrite = count($args) > 4 ? ($args[4] == "overwrite" || $args[4] == "true" ? true : false) : false;
756
-        $this->_prefix = count($args) > 5 ? $args[5] : '';
757
-        $this->_postfix = count($args) > 6 ? $args[6] : '';
758
-
759
-        if ($app_dir !== false) {
760
-            $config = $this->getActiveRecordConfig($app_dir);
761
-
762
-            $manager = TActiveRecordManager::getInstance();
763
-            $con = $manager->getDbConnection();
764
-            $con->Active = true;
765
-            $command = $con->createCommand("Show Tables");
766
-            $dataReader = $command->query();
767
-            $dataReader->bindColumn(1, $table);
768
-            $generator = new PHP_Shell_Extensions_ActiveRecord();
769
-            $tables = array();
770
-            while ($dataReader->read() !== false) {
771
-                $tables[] = $table;
772
-            }
773
-            $con->Active = False;
774
-            foreach ($tables as $key => $table) {
775
-                $output = $args[1] . "." . $this->_prefix . ucfirst($table) . $this->_postfix;
776
-                if ($config !== false && $output !== false) {
777
-                    $generator->generate("generate " . $table . " " . $output . " " . $this->_soap . " " . $this->_overwrite);
778
-                }
779
-            }
780
-        }
781
-        return true;
782
-    }
783
-
784
-    protected function getAppDir($dir=".") {
785
-        if (is_dir($dir))
786
-            return realpath($dir);
787
-        if (false !== ($app_dir = realpath($dir . '/protected/')) && is_dir($app_dir))
788
-            return $app_dir;
789
-        echo '** Unable to find directory "' . $dir . "\".\n";
790
-        return false;
791
-    }
792
-
793
-    protected function getXmlFile($app_dir) {
794
-        if (false !== ($xml = realpath($app_dir . '/application.xml')) && is_file($xml))
795
-            return $xml;
796
-        if (false !== ($xml = realpath($app_dir . '/protected/application.xml')) && is_file($xml))
797
-            return $xml;
798
-        echo '** Unable to find application.xml in ' . $app_dir . "\n";
799
-        return false;
800
-    }
801
-
802
-    protected function getActiveRecordConfig($app_dir) {
803
-        if (false === ($xml = $this->getXmlFile($app_dir)))
804
-            return false;
805
-        if (false !== ($app = $this->initializePradoApplication($app_dir))) {
806
-            Prado::using('System.Data.ActiveRecord.TActiveRecordConfig');
807
-            foreach ($app->getModules() as $module)
808
-                if ($module instanceof TActiveRecordConfig)
809
-                    return $module;
810
-            echo '** Unable to find TActiveRecordConfig module in ' . $xml . "\n";
811
-        }
812
-        return false;
813
-    }
814
-
815
-    protected function getOutputFile($app_dir, $namespace) {
816
-        if (is_file($namespace) && strpos($namespace, $app_dir) === 0)
817
-            return $namespace;
818
-        $file = Prado::getPathOfNamespace($namespace, "");
819
-        if ($file !== null && false !== ($path = realpath(dirname($file))) && is_dir($path)) {
820
-            if (strpos($path, $app_dir) === 0)
821
-                return $file;
822
-        }
823
-        echo '** Output file ' . $file . ' must be within directory ' . $app_dir . "\n";
824
-        return false;
825
-    }
743
+	protected $action = 'generateAll';
744
+	protected $parameters = array('output');
745
+	protected $optional = array('directory', 'soap', 'overwrite', 'prefix', 'postfix');
746
+	protected $description = "Generate Active Record skeleton for all Tables to <output> file using application.xml in [directory]. May also generate [soap] properties.\nGenerated Classes are named like the Table with optional [Prefix] and/or [Postfix]. [Overwrite] is used to overwrite existing Files.";
747
+	private $_soap = false;
748
+	private $_prefix = '';
749
+	private $_postfix = '';
750
+	private $_overwrite = false;
751
+
752
+	public function performAction($args) {
753
+		$app_dir = count($args) > 2 ? $this->getAppDir($args[2]) : $this->getAppDir();
754
+		$this->_soap = count($args) > 3 ? ($args[3] == "soap" || $args[3] == "true" ? true : false) : false;
755
+		$this->_overwrite = count($args) > 4 ? ($args[4] == "overwrite" || $args[4] == "true" ? true : false) : false;
756
+		$this->_prefix = count($args) > 5 ? $args[5] : '';
757
+		$this->_postfix = count($args) > 6 ? $args[6] : '';
758
+
759
+		if ($app_dir !== false) {
760
+			$config = $this->getActiveRecordConfig($app_dir);
761
+
762
+			$manager = TActiveRecordManager::getInstance();
763
+			$con = $manager->getDbConnection();
764
+			$con->Active = true;
765
+			$command = $con->createCommand("Show Tables");
766
+			$dataReader = $command->query();
767
+			$dataReader->bindColumn(1, $table);
768
+			$generator = new PHP_Shell_Extensions_ActiveRecord();
769
+			$tables = array();
770
+			while ($dataReader->read() !== false) {
771
+				$tables[] = $table;
772
+			}
773
+			$con->Active = False;
774
+			foreach ($tables as $key => $table) {
775
+				$output = $args[1] . "." . $this->_prefix . ucfirst($table) . $this->_postfix;
776
+				if ($config !== false && $output !== false) {
777
+					$generator->generate("generate " . $table . " " . $output . " " . $this->_soap . " " . $this->_overwrite);
778
+				}
779
+			}
780
+		}
781
+		return true;
782
+	}
783
+
784
+	protected function getAppDir($dir=".") {
785
+		if (is_dir($dir))
786
+			return realpath($dir);
787
+		if (false !== ($app_dir = realpath($dir . '/protected/')) && is_dir($app_dir))
788
+			return $app_dir;
789
+		echo '** Unable to find directory "' . $dir . "\".\n";
790
+		return false;
791
+	}
792
+
793
+	protected function getXmlFile($app_dir) {
794
+		if (false !== ($xml = realpath($app_dir . '/application.xml')) && is_file($xml))
795
+			return $xml;
796
+		if (false !== ($xml = realpath($app_dir . '/protected/application.xml')) && is_file($xml))
797
+			return $xml;
798
+		echo '** Unable to find application.xml in ' . $app_dir . "\n";
799
+		return false;
800
+	}
801
+
802
+	protected function getActiveRecordConfig($app_dir) {
803
+		if (false === ($xml = $this->getXmlFile($app_dir)))
804
+			return false;
805
+		if (false !== ($app = $this->initializePradoApplication($app_dir))) {
806
+			Prado::using('System.Data.ActiveRecord.TActiveRecordConfig');
807
+			foreach ($app->getModules() as $module)
808
+				if ($module instanceof TActiveRecordConfig)
809
+					return $module;
810
+			echo '** Unable to find TActiveRecordConfig module in ' . $xml . "\n";
811
+		}
812
+		return false;
813
+	}
814
+
815
+	protected function getOutputFile($app_dir, $namespace) {
816
+		if (is_file($namespace) && strpos($namespace, $app_dir) === 0)
817
+			return $namespace;
818
+		$file = Prado::getPathOfNamespace($namespace, "");
819
+		if ($file !== null && false !== ($path = realpath(dirname($file))) && is_dir($path)) {
820
+			if (strpos($path, $app_dir) === 0)
821
+				return $file;
822
+		}
823
+		echo '** Output file ' . $file . ' must be within directory ' . $app_dir . "\n";
824
+		return false;
825
+	}
826 826
 
827 827
 }
828 828
 
@@ -830,20 +830,20 @@  discard block
 block discarded – undo
830 830
 if(class_exists('PHP_Shell_Commands', false))
831 831
 {
832 832
 	class PHP_Shell_Extensions_ActiveRecord implements PHP_Shell_Extension {
833
-	    public function register()
834
-	    {
833
+		public function register()
834
+		{
835 835
 
836
-	        $cmd = PHP_Shell_Commands::getInstance();
836
+			$cmd = PHP_Shell_Commands::getInstance();
837 837
 			if(Prado::getApplication() !== null)
838 838
 			{
839
-		        $cmd->registerCommand('#^generate#', $this, 'generate', 'generate <table> <output> [soap]',
840
-		            'Generate Active Record skeleton for <table> to <output> file using'.PHP_EOL.
841
-		            '    application.xml in [directory]. May also generate [soap] properties.');
839
+				$cmd->registerCommand('#^generate#', $this, 'generate', 'generate <table> <output> [soap]',
840
+					'Generate Active Record skeleton for <table> to <output> file using'.PHP_EOL.
841
+					'    application.xml in [directory]. May also generate [soap] properties.');
842 842
 			}
843
-	    }
843
+		}
844 844
 
845
-	    public function generate($l)
846
-	    {
845
+		public function generate($l)
846
+		{
847 847
 			$input = explode(" ", trim($l));
848 848
 			if(count($input) > 2)
849 849
 			{
@@ -860,12 +860,12 @@  discard block
 block discarded – undo
860 860
 			{
861 861
 				echo "\n    Usage: generate table_name Application.pages.RecordClassName\n";
862 862
 			}
863
-	    }
863
+		}
864 864
 	}
865 865
 
866 866
 	$__shell_exts = PHP_Shell_Extensions::getInstance();
867 867
 	$__shell_exts->registerExtensions(array(
868
-		    "active-record"        => new PHP_Shell_Extensions_ActiveRecord)); /* the :set command */
868
+			"active-record"        => new PHP_Shell_Extensions_ActiveRecord)); /* the :set command */
869 869
 
870 870
 	include_once(realpath(dirname(dirname(__FILE__))).'/framework/3rdParty/PhpShell/php-shell-cmd.php');
871 871
 }
Please login to merge, or discard this patch.
buildscripts/classtree/build.php 1 patch
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -67,6 +67,9 @@  discard block
 block discarded – undo
67 67
 		$this->displayTreeInternal(array_keys($this->_baseClasses),0);
68 68
 	}
69 69
 
70
+	/**
71
+	 * @param integer $level
72
+	 */
70 73
 	public function displayTreeInternal($classNames,$level)
71 74
 	{
72 75
 		foreach($classNames as $className)
@@ -153,6 +156,9 @@  discard block
 block discarded – undo
153 156
 		}
154 157
 	}
155 158
 
159
+	/**
160
+	 * @param string $path
161
+	 */
156 162
 	protected function isValidPath($path)
157 163
 	{
158 164
 		if(is_dir($path))
@@ -161,6 +167,9 @@  discard block
 block discarded – undo
161 167
 			return basename($path)!==basename($path,'.php') && !isset($this->_exclusions[basename($path)]);
162 168
 	}
163 169
 
170
+	/**
171
+	 * @param string $path
172
+	 */
164 173
 	public function getSourceFiles($path)
165 174
 	{
166 175
 		$files=array();
@@ -227,6 +236,9 @@  discard block
 block discarded – undo
227 236
 
228 237
 	}
229 238
 
239
+	/**
240
+	 * @param PradoVTMDocument $doc
241
+	 */
230 242
 	private	function processObjectType($objectType,$objectInfo,$prefix,$doc)
231 243
 	{
232 244
 		foreach($objectInfo['Properties'] as $name=>$property)
Please login to merge, or discard this patch.
buildscripts/classtree/DWExtension.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -100,6 +100,9 @@
 block discarded – undo
100 100
 	private $_filesElement;
101 101
 	private $_document;
102 102
 
103
+	/**
104
+	 * @param string $version
105
+	 */
103 106
 	public function __construct($version)
104 107
 	{
105 108
 		$this->_document = new DOMDocument('1.0', 'utf-8');
Please login to merge, or discard this patch.
buildscripts/index/api_index.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -10,6 +10,9 @@
 block discarded – undo
10 10
 	private $_index;	
11 11
 	private $_api;
12 12
 	
13
+	/**
14
+	 * @param string $api
15
+	 */
13 16
 	public function __construct($index_file, $api)
14 17
 	{
15 18
 		$this->_api = $api;
Please login to merge, or discard this patch.
buildscripts/index/quickstart_index.php 1 patch
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -8,6 +8,10 @@  discard block
 block discarded – undo
8 8
 	private $_base;
9 9
 	private $_source;
10 10
 
11
+	/**
12
+	 * @param string $base
13
+	 * @param string $source
14
+	 */
11 15
 	public function __construct($index_file, $base, $source)
12 16
 	{
13 17
 		$this->_index = new Zend_Search_Lucene($index_file, true);
@@ -37,6 +41,10 @@  discard block
 block discarded – undo
37 41
 		echo "\n {$count} files indexed.\n";
38 42
 	}
39 43
 
44
+	/**
45
+	 * @param string $content
46
+	 * @param integer $mtime
47
+	 */
40 48
 	public function add($content, $section, $mtime)
41 49
 	{
42 50
 		foreach($this->split_headings($content) as $headers)
Please login to merge, or discard this patch.
buildscripts/texbuilder/Page2Tex.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -71,6 +71,9 @@
 block discarded – undo
71 71
 		}
72 72
 	}
73 73
 
74
+	/**
75
+	 * @param string $filename
76
+	 */
74 77
 	function include_figure($info, $filename)
75 78
 	{
76 79
 		$width = sprintf('%0.2f', $info[0]/(135/2.54));
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -167,10 +167,10 @@
 block discarded – undo
167 167
 
168 168
 		//DocLink
169 169
 		$html = preg_replace('/<com:DocLink\s+ClassPath="([^"]*)[.]([^."]*)"\s+Text="([^"]+)"\s*\/>/',
170
-	                        '\href{http://pradosoft.github.io/docs/manual/$1/$2.html}{$3}', $html);
170
+							'\href{http://pradosoft.github.io/docs/manual/$1/$2.html}{$3}', $html);
171 171
 
172 172
 		$html = preg_replace('/<com:DocLink\s+ClassPath="([^"]*)[.]([^.]*)"\s+\/>/',
173
-	                        '\href{http://pradosoft.github.io/docs/manual/$1/$2.html}{$1.$2 API Reference}', $html);
173
+							'\href{http://pradosoft.github.io/docs/manual/$1/$2.html}{$1.$2 API Reference}', $html);
174 174
 
175 175
 		//text modifiers
176 176
 		$html = preg_replace('/<(b|strong)[^>]*>([^<]*)<\/(b|strong)>/', '\textbf{$2}', $html);
Please login to merge, or discard this patch.
demos/blog-tutorial/samples/day5/blog/protected/pages/posts/ListPost.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -48,6 +48,7 @@
 block discarded – undo
48 48
 
49 49
 	/**
50 50
 	 * Fetches posts from database with offset and limit.
51
+	 * @param double $offset
51 52
 	 */
52 53
 	protected function getPosts($offset, $limit)
53 54
 	{
Please login to merge, or discard this patch.
demos/blog/protected/Common/BlogUserManager.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 	/**
30 30
 	 * Returns a user instance given the user name.
31 31
 	 * @param string user name, null if it is a guest.
32
-	 * @return TUser the user instance, null if the specified username is not in the user database.
32
+	 * @return BlogUser|null the user instance, null if the specified username is not in the user database.
33 33
 	 */
34 34
 	public function getUser($username=null)
35 35
 	{
Please login to merge, or discard this patch.
demos/blog/protected/Pages/SearchPost.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -32,6 +32,9 @@
 block discarded – undo
32 32
 		return $limit;
33 33
 	}
34 34
 
35
+	/**
36
+	 * @param integer $newOffset
37
+	 */
35 38
 	private function formUrl($newOffset)
36 39
 	{
37 40
 		$gets=array();
Please login to merge, or discard this patch.