Permalink
Browse files

[PSR-2] fixers=braces,elseif,short_tag,php_closing_tag,trailing_space…

…s,linefeed

Applied php-cs-fixer --fixers=braces,elseif,short_tag,php_closing_tag,trailing_spaces,linefeed
  • Loading branch information...
1 parent f6bf335 commit 52461005286b6afee106339a05ecf3558a13f5ac @Maks3w Maks3w committed Jul 12, 2012
Showing 1,410 changed files with 30,812 additions and 29,844 deletions.
@@ -147,7 +147,7 @@
// Get the ClassFileLocator, and pass it the library path
$l = new ClassFileLocator($libraryPath);
-// Iterate over each element in the path, and create a map of
+// Iterate over each element in the path, and create a map of
// classname => filename, where the filename is relative to the library path
$map = new stdClass;
foreach ($l as $file) {
@@ -2,9 +2,9 @@
/**
* createAutoloadTestClasses.php
*
- * A script for creating a hierarchy of classes for use with testing
- * autoloading. Each directory has classes from a to p; additional classes are
- * generated 2 levels deep, giving a total of 16^3 classes to use in
+ * A script for creating a hierarchy of classes for use with testing
+ * autoloading. Each directory has classes from a to p; additional classes are
+ * generated 2 levels deep, giving a total of 16^3 classes to use in
* autoloading tests.
*/
View
@@ -26,7 +26,7 @@
/*
* Convert the ZF documentation from DocBook to reStructuredText format
- *
+ *
* Usage:
* --help|-h Get usage message
* --docbook|-d Docbook file to convert
@@ -43,7 +43,7 @@
echo "Unable to locate autoloader via include_path; aborting" . PHP_EOL;
exit(2);
}
-} elseif (false === include($libPath . '/Zend/Loader/StandardAutoloader.php')) {
+} elseif (false === include($libPath . '/Zend/Loader/StandardAutoloader.php')) {
echo "Unable to locate autoloader via library; aborting" . PHP_EOL;
exit(2);
}
@@ -76,7 +76,7 @@
echo "Error: the docbook file $docbook doesn't exist.\n";
exit(2);
}
-
+
$rstFile = $opts->getOption('o');
if (empty($rstFile)) {
if (substr($docbook,-4) === '.xml') {
@@ -102,10 +102,10 @@
$proc = new \XSLTProcessor;
$proc->registerPHPFunctions();
-$proc->importStyleSheet($xsl);
+$proc->importStyleSheet($xsl);
echo "Writing to $rstFile\n";
-
+
$output = $proc->transformToXml($xml);
if (false === $output) {
echo "Error during the conversion\n";
@@ -132,19 +132,20 @@
exit(0);
/**
- * XSLT php:function()
+ * XSLT php:function()
*/
-class RstConvert {
-
+class RstConvert
+{
public static $links = array();
-
+
/**
* Convert the programlisting tag
- *
+ *
* @param string $text
- * @return string
+ * @return string
*/
- public static function programlisting($text) {
+ public static function programlisting($text)
+ {
$rows = explode("\n", $text);
$output = "\n.. code-block:: php\n :linenos:\n";
foreach ($rows as $row) {
@@ -155,18 +156,19 @@ public static function programlisting($text) {
/**
* Convert the note tag
- *
+ *
* @param string $text
- * @return string
+ * @return string
*/
- public static function note($text) {
+ public static function note($text)
+ {
$rows = explode("\n", $text);
$tot = count($rows);
if ('' !== trim($rows[0])) {
$output = " **" . trim($rows[0]) . "**\n";
} else {
$output = '';
- }
+ }
for ($i=1; $i < $tot; $i++) {
if ('' !== trim($rows[$i])) {
$output .= " {$rows[$i]}\n";
@@ -177,11 +179,12 @@ public static function note($text) {
/**
* Convert the listitem tag
- *
+ *
* @param string $text
- * @return string
+ * @return string
*/
- public static function listitem($text) {
+ public static function listitem($text)
+ {
$rows = explode("\n", $text);
$output = "\n";
foreach ($rows as $row) {
@@ -195,11 +198,12 @@ public static function listitem($text) {
/**
* Convert the first section/title tag (maintitle)
- *
+ *
* @param string $text
- * @return string
+ * @return string
*/
- public static function maintitle($text) {
+ public static function maintitle($text)
+ {
$text = str_replace('\\', '\\\\', trim($text));
$count = strlen($text);
$output = $text . "\n";
@@ -209,11 +213,12 @@ public static function maintitle($text) {
/**
* Convert all the section/title, except for the first
- *
+ *
* @param string $text
- * @return string
+ * @return string
*/
- public static function title($text) {
+ public static function title($text)
+ {
$text = str_replace('\\', '\\\\', trim($text));
$count = strlen($text);
$output = "\n" . $text . "\n";
@@ -223,50 +228,54 @@ public static function title($text) {
/**
* Format the string removing \n, multiple white spaces and \ in \\
- *
+ *
* @param string $text
- * @return string
+ * @return string
*/
- public static function formatText($text) {
+ public static function formatText($text)
+ {
return str_replace('\\', '\\\\', trim(preg_replace('/\s+/', ' ', str_replace("\n", '', $text))));
}
/**
* Conver the link tag
- *
+ *
* @param DOMElement $node
- * @return string
+ * @return string
*/
- public static function link($node) {
+ public static function link($node)
+ {
$value = self::formatText($node[0]->nodeValue);
if ($node[0]->getAttribute('linkend')) {
return " :ref:`$value <" . $node[0]->getAttribute('linkend') . ">` ";
} else {
self::$links[$value] = $node[0]->getAttribute('xlink:href');
return " `$value`_ ";
- }
+ }
}
-
+
/**
* Get all the external links of the document
- *
- * @return string
+ *
+ * @return string
*/
- public static function getLinks() {
+ public static function getLinks()
+ {
$output = '';
foreach (self::$links as $key => $value) {
$output .= ".. _`$key`: $value\n";
}
return $output;
}
-
+
/**
* Convert the table tag
- *
+ *
* @param DOMElement $node
* @return string
*/
- public static function table($node) {
+ public static function table($node)
+ {
// check if thead exists
if (0 !== $node[0]->getElementsByTagName('thead')->length) {
$head = true;
@@ -304,7 +313,7 @@ public static function table($node) {
$row->appendColumn(new Table\Column($table[$j][$i]));
}
$tableText->appendRow($row);
- }
+ }
$output = $tableText->render();
// if thead exists change the table style with head (= instead of -)
if ($head) {
@@ -324,15 +333,16 @@ public static function table($node) {
}
return $output;
}
-
+
/**
- * Convert an XML file name to the RST ZF2 standard naming convention
+ * Convert an XML file name to the RST ZF2 standard naming convention
* For instance, Zend_Config-XmlIntro.xml become zend.config.xml-intro.rst
- *
+ *
* @param string $name
- * @return string
+ * @return string
*/
- public static function XmlFileNameToRst($name) {
+ public static function XmlFileNameToRst($name)
+ {
if ('.xml' === strtolower(substr($name, -4))) {
$name = substr($name, 0, strlen($name)-4);
}
View
@@ -29,15 +29,15 @@
/**
* Generate Docbook XML skeleton for a given class as a documentation stub.
*
- * Additionally, it parses all public methods of the class and creates stub
+ * Additionally, it parses all public methods of the class and creates stub
* documentation for each in the "Available Methods" section of the class
* documentation.
*
* Usage:
* --help|-h Get usage message
* --class|-c [ <string> ] Class name for which to provide documentation
* --output|-o [ <string> ] Where to write generated documentation. By default,
- * assumes documentation/manual/en/module_specs, in a
+ * assumes documentation/manual/en/module_specs, in a
* file named after the provided class (in the form of
* "zend.component.class-name.xml")
*/
@@ -28,12 +28,12 @@
*
* Usage:
* --help|-h Get usage message
- * --library|-l [ <string> ] Library to parse; if none provided, assumes
+ * --library|-l [ <string> ] Library to parse; if none provided, assumes
* current directory
- * --output|-o [ <string> ] Where to write autoload file; if not provided,
+ * --output|-o [ <string> ] Where to write autoload file; if not provided,
* assumes "autoload_classmap.php" in library directory
* --append|-a Append to autoload file if it exists
- * --overwrite|-w Whether or not to overwrite existing autoload
+ * --overwrite|-w Whether or not to overwrite existing autoload
* file
*/
@@ -109,7 +109,7 @@
} elseif (file_exists($output)) {
if (!$opts->getOption('w') && !$appending) {
echo "Plugin map file already exists at '$output'," . PHP_EOL
- . "but 'overwrite' flag was not specified; aborting." . PHP_EOL
+ . "but 'overwrite' flag was not specified; aborting." . PHP_EOL
. PHP_EOL
. $opts->getUsageMessage();
exit(2);
@@ -128,7 +128,7 @@
// Get the ClassFileLocator, and pass it the library path
$l = new \Zend\File\ClassFileLocator($path);
-// Iterate over each element in the path, and create a map of pluginname => classname
+// Iterate over each element in the path, and create a map of pluginname => classname
$map = new \stdClass;
foreach($l as $file) {
$namespace = empty($file->namespace) ? '' : $file->namespace . '\\';
@@ -151,15 +151,15 @@
// Load existing class map file and remove the closing "bracket ");" from it
$existing = file($output, FILE_IGNORE_NEW_LINES);
- array_pop($existing);
+ array_pop($existing);
// Merge
$content = implode(PHP_EOL, $existing + $content);
} else {
// Create a file with the class/file map.
// Stupid syntax highlighters make separating < from PHP declaration necessary
$content = '<' . "?php\n\n"
- . "// plugin class map\n"
+ . "// plugin class map\n"
. "// auto-generated using "
. basename($_SERVER['argv'][0]) . ', ' . date('Y-m-d H:i:s') . "\n\n"
. 'return ' . var_export((array) $map, true) . ';';
@@ -117,20 +117,23 @@
}
</style>
<script type="text/javascript">
- function startProgress() {
+ function startProgress()
+ {
var iFrame = document.createElement('iframe');
document.getElementsByTagName('body')[0].appendChild(iFrame);
iFrame.src = 'JsPush.php?progress';
}
- function Zend_ProgressBar_Update(data) {
+ function Zend_ProgressBar_Update(data)
+ {
document.getElementById('pg-percent').style.width = data.percent + '%';
document.getElementById('pg-text-1').innerHTML = data.text;
document.getElementById('pg-text-2').innerHTML = data.text;
}
- function Zend_ProgressBar_Finish() {
+ function Zend_ProgressBar_Finish()
+ {
document.getElementById('pg-percent').style.width = '100%';
document.getElementById('pg-text-1').innerHTML = 'Demo done';
Oops, something went wrong.

0 comments on commit 5246100

Please sign in to comment.