Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .devcontainer/Dockerfile

This file was deleted.

35 changes: 0 additions & 35 deletions .devcontainer/devcontainer.json

This file was deleted.

4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Auto detect text files and perform LF normalization
* text=auto

# enable syntax highlighting with closest language
# available for Doxygen's configuration file
Doxyfile linguist-language=INI
14 changes: 7 additions & 7 deletions LIBRARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

[license-badge]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square
[license-url]: #license
[docs-badge]: https://img.shields.io/github/deployments/neoncitylights/php-template/github-pages?label=docs&style=flat-square
[docs-url]: https://neoncitylights.github.io/php/
[ci-badge]: https://img.shields.io/github/actions/workflow/status/neoncitylights/php/.github/workflows/php.yml?style=flat-square
[ci-url]: https://github.com/neoncitylights/php/actions/workflows/php.yml
[docs-badge]: https://img.shields.io/github/deployments/php-lights/php/github-pages?label=docs&style=flat-square
[docs-url]: https://php-lights.github.io/php/
[ci-badge]: https://img.shields.io/github/actions/workflow/status/php-lights/php/.github/workflows/php.yml?style=flat-square
[ci-url]: https://github.com/php-lights/php/actions/workflows/php.yml

Describe the library.

Expand All @@ -19,10 +19,10 @@ composer install author/package

## Usage
```php
use Neoncitylights\ExampleLibrary\Dog;
use Neoncitylights\ExampleLibrary\HelloWorld;

$dog = new Dog();
$dog->bark(); // "Woof!"
$greet1 = HelloWorld::greet(); // 'Hello World'
$greet2 = HelloWorld::greet( 'Bob' ); // 'Hello Bob'
```

## License
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PHP Repository Template
# PHP template

> This template is based on my past history with developing MediaWiki software, and largely based on MediaWiki's own repository template for PHP projects.
>
Expand All @@ -11,12 +11,11 @@ This repository makes it easier to develop a PHP application or library by provi
## Features

- [x] [PHP 8.3+](https://www.php.net/releases/8.3/en.php) support
- [x] *Unit testing* with [PHPUnit](https://github.com/sebastianbergmann/phpunit/) ([official website](https://phpunit.de/))
- [x] Unit testing with [PHPUnit](https://github.com/sebastianbergmann/phpunit/) ([official website](https://phpunit.de/))
- [x] Validates PHP syntax with [php-parallel-lint](https://github.com/php-parallel-lint/PHP-Parallel-Lint)
- [x] Lint and auto-format PHP code with [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) (PHPCS)
- [x] Continuous integration with [GitHub Actions](https://github.com/features/actions)
- [x] auto-generated documentation with [phpDocumentor](https://www.phpdoc.org/), [GitHub Pages](https://docs.github.com/en/pages)
- [x] Remote development with [GitHub Codespaces](https://github.com/features/codespaces)
- [x] Composer dependency updates auto-managed with Dependabot

## Getting started
Expand All @@ -26,17 +25,16 @@ Choose a method:
- **GitHub UI**: Press the "Use this template" button in the top-right corner of this page.
- **GitHub CLI**: Install [GitHub CLI](https://cli.github.com). Then run one of the following:
```shell
gh repo create --template neoncitylights/php --public --clone {{repository}} # clone as public
gh repo create --template neoncitylights/php --private --clone {{repository}} # clone as private
gh repo create --template php-lights/php --public --clone {{repository}} # clone as public
gh repo create --template php-lights/php --private --clone {{repository}} # clone as private
```

### Replace placeholders

Using your text editor or IDE, find-and-replace the following placeholders:

- `{repo-name}`: Replace with the name of your repository
- `author/package`: Replace with your own author and package name.
- `neoncitylights/php-template`: Replace with the name of your GitHub repository.
- `php-lights/php`: Replace with the name of your GitHub repository.
- `Neoncitylights\ExampleLibrary`: Replace with your own namespace.
- `Neoncitylights\\ExampleLibrary\\`: Replace with your own namespace (escaped version using double backslashes).

Expand All @@ -58,7 +56,7 @@ Delete this `README.md`, and rename [`LIBRARY.md`](./LIBRARY.md) to `README.md`.

## License

This software is licensed under the MIT license ([`LICENSE-MIT`](./LICENSE) or <http://opensource.org/licenses/MIT>).
This software is licensed under the MIT license ([`LICENSE`](./LICENSE) or <http://opensource.org/licenses/MIT>).

### Contribution

Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
Expand Down
34 changes: 0 additions & 34 deletions src/Dog.php

This file was deleted.

9 changes: 9 additions & 0 deletions src/HelloWorld.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Neoncitylights\ExampleLibrary;

class HelloWorld {
public static function greet( string $s = "World" ): string {
return "Hello {$s}";
}
}
22 changes: 0 additions & 22 deletions src/IAnimal.php

This file was deleted.

26 changes: 0 additions & 26 deletions tests/DogTest.php

This file was deleted.

18 changes: 18 additions & 0 deletions tests/HelloWorldTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Neoncitylights\ExampleLibrary\Tests;

use Neoncitylights\ExampleLibrary\HelloWorld;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;

#[CoversClass( HelloWorld::class )]
class HelloWorldTest extends TestCase {
public function testDefault(): void {
$this->assertSame( 'Hello World', HelloWorld::greet() );
}

public function testWithArgument(): void {
$this->assertSame( 'Hello Bob', HelloWorld::greet( 'Bob' ) );
}
}