Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D digitec-wiki
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Digitec
  • digitec-wiki
  • Wiki
  • php coding standards

php coding standards · Changes

Page history
rcabral created page: dependency-management authored Mar 23, 2014 by Rene Cabral's avatar Rene Cabral
Show whitespace changes
Inline Side-by-side
php-coding-standards.markdown
View page @ 84075846
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
--- ---
# <a name='PHPCodingStandards'> </a>PHP Coding Standards # PHP Coding Standards
## <a name='ShamelessCopyofSymfonyStandarts'> </a>Shameless Copy of Symfony Standards ## Shameless Copy of Symfony Standards
__These standardts are borrowed from the Symfony Standards. They are edited by Digitec when appropriate.__
Remember that the main advantage of standards is that every piece of code looks and feels familiar, it's not about this or that being more readable. Remember that the main advantage of standards is that every piece of code looks and feels familiar, it's not about this or that being more readable.
KD7 will follow the standards defined in the PSR-0, PSR-1 and PSR-2 documents. KD7 will follow the standards defined in the PSR-0, PSR-1 and PSR-2 documents.
...@@ -22,15 +22,13 @@ Since a picture - or some code - is worth a thousand words, here's a short examp ...@@ -22,15 +22,13 @@ Since a picture - or some code - is worth a thousand words, here's a short examp
```php ```php
<?php <?php
/* /*
* This file is part of the Symfony package. * This file is part of the KD package.
* *
* (c) Fabien Potencier <fabien@symfony.com> * (c) Digitec Interactive
* *
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
...@@ -41,8 +39,7 @@ namespace Acme; ...@@ -41,8 +39,7 @@ namespace Acme;
/** /**
* Coding standards demonstration. * Coding standards demonstration.
*/ */
class FooBar class FooBar {
{
const SOME_CONST = 42; const SOME_CONST = 42;
private $fooBar; private $fooBar;
...@@ -50,9 +47,8 @@ class FooBar ...@@ -50,9 +47,8 @@ class FooBar
/** /**
* @param string $dummy Some argument description * @param string $dummy Some argument description
*/ */
public function __construct($dummy) public function __construct ($dummy) {
{ $this->fooBar = $this->transformText ($dummy);
$this->fooBar = $this->transformText($dummy);
} }
/** /**
...@@ -61,8 +57,7 @@ class FooBar ...@@ -61,8 +57,7 @@ class FooBar
* *
* @return string|null Transformed input * @return string|null Transformed input
*/ */
private function transformText($dummy, array $options = array()) private function transformText($dummy, array $options = array()) {
{
$mergedOptions = array_merge( $mergedOptions = array_merge(
$options, $options,
array( array(
......
Clone repository
  • alpha beta testing
  • browser testing
  • camtasia licenses
  • code delivery processes
  • coding practices
  • css and sass coding standards
  • database schema standards
  • dependency management
  • development environments
  • digitec agile process
  • digitec gitlab styles
  • digitec software promises
  • digitec spec process
  • gitlab administration
  • gitlab issues tags
View All Pages