├── CODE_OF_CONDUCT.md ├── src └── Example.php ├── LICENSE ├── composer.json ├── phpunit.xml.dist └── .php_cs.dist /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This code of conduct is derived from the Ruby code of conduct. Any violations of the code of conduct may be reported to (owner@email.com). 4 | 5 | - Participants will be tolerant of opposing views. 6 | - Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks. 7 | - When interpreting the words and actions of others, participants should always assume good intentions. 8 | - Behavior which can be reasonably considered harassment will not be tolerated. 9 | -------------------------------------------------------------------------------- /src/Example.php: -------------------------------------------------------------------------------- 1 | name = $name; 24 | } 25 | 26 | /** 27 | * Get the name of the project. 28 | * 29 | * @return string $name 30 | */ 31 | public function name(): string 32 | { 33 | return $this->name; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Owner Name 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "thavarshan/base", 3 | "description": "A basic repository for quickly scaffolding typical PHP packages", 4 | "keywords": [ 5 | "php", 6 | "basic", 7 | "package" 8 | ], 9 | "license": "MIT", 10 | "authors": [ 11 | { 12 | "name": "Thavarshan Thayananthajothy", 13 | "email": "tjthavarshan@gmail.com" 14 | } 15 | ], 16 | "require": { 17 | "php": "^7.4|^8.0" 18 | }, 19 | "require-dev": { 20 | "mockery/mockery": "^1.4.2", 21 | "phpunit/phpunit": "^9.5", 22 | "symfony/var-dumper": "^5.3" 23 | }, 24 | "autoload": { 25 | "psr-4": { 26 | "Base\\": "src/" 27 | } 28 | }, 29 | "autoload-dev": { 30 | "psr-4": { 31 | "Base\\Tests\\": "tests/" 32 | } 33 | }, 34 | "scripts": { 35 | "test": "vendor/bin/phpunit --colors=always", 36 | "test-coverage": "vendor/bin/phpunit --coverage-html coverage" 37 | }, 38 | "config": { 39 | "sort-packages": true, 40 | "preferred-install": "dist" 41 | }, 42 | "minimum-stability": "dev", 43 | "prefer-stable": true 44 | } 45 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | tests 23 | 24 | 25 | 26 | 27 | ./src 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /.php_cs.dist: -------------------------------------------------------------------------------- 1 | exclude('node_modules') 5 | ->exclude('vendor') 6 | ->in(__DIR__); 7 | 8 | return PhpCsFixer\Config::create() 9 | ->setRiskyAllowed(true) 10 | ->setRules([ 11 | '@PSR2' => true, 12 | 'phpdoc_no_empty_return' => false, 13 | 'array_syntax' => ['syntax' => 'short'], 14 | 'yoda_style' => false, 15 | 'cast_spaces' => true, 16 | 'new_with_braces' => true, 17 | 'concat_space' => ['spacing' => 'one'], 18 | 'not_operator_with_space' => false, 19 | 'blank_line_before_return' => false, 20 | 'blank_line_before_statement' => [ 21 | 'break', 22 | 'continue', 23 | 'declare', 24 | 'return', 25 | 'throw', 26 | 'try', 27 | ], 28 | 'method_argument_space' => [ 29 | 'ensure_fully_multiline' => true, 30 | ], 31 | 'not_operator_with_successor_space' => true, 32 | 'ordered_imports' => ['sort_algorithm' => 'length'], 33 | 'combine_consecutive_unsets' => true, 34 | 'linebreak_after_opening_tag' => true, 35 | 'no_blank_lines_after_class_opening' => true, 36 | 'no_blank_lines_after_phpdoc' => true, 37 | 'no_extra_consecutive_blank_lines' => true, 38 | 'no_trailing_comma_in_singleline_array' => true, 39 | 'no_whitespace_in_blank_line' => true, 40 | 'no_spaces_around_offset' => true, 41 | 'no_unused_imports' => true, 42 | 'no_useless_else' => true, 43 | 'no_useless_return' => true, 44 | 'no_whitespace_before_comma_in_array' => true, 45 | 'normalize_index_brace' => true, 46 | 'phpdoc_indent' => true, 47 | 'phpdoc_to_comment' => true, 48 | 'phpdoc_trim' => true, 49 | 'general_phpdoc_annotation_remove' => [], 50 | 'no_superfluous_phpdoc_tags' => false, 51 | 'single_quote' => true, 52 | 'ternary_to_null_coalescing' => true, 53 | 'trailing_comma_in_multiline_array' => true, 54 | 'trim_array_spaces' => true, 55 | 'no_break_comment' => false, 56 | 'blank_line_before_statement' => true, 57 | ]) 58 | ->setFinder($finder); 59 | --------------------------------------------------------------------------------