svn: /phpdoc/ja/trunk/language/ attributes.xml
[email protected] (Yoshinari Takaoka)
| Newsgroups | php.doc.ja |
|---|---|
| Message-ID | <[email protected]> |
mumumu Sun, 06 Dec 2020 21:49:59 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=351929
Log:
Fix typo and remove @
We also applies some proper code formatting.
Closes GH-271.
Changed paths:
U phpdoc/ja/trunk/language/attributes.xml
Modified: phpdoc/ja/trunk/language/attributes.xml
===================================================================
--- phpdoc/ja/trunk/language/attributes.xml 2020-12-06 17:50:04 UTC (rev 351928)
+++ phpdoc/ja/trunk/language/attributes.xml 2020-12-06 21:49:59 UTC (rev 351929)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: 351915 Maintainer: mumumu Status: ready -->
+<!-- EN-Revision: 351926 Maintainer: mumumu Status: ready -->
<chapter xml:id="language.attributes" xmlns="http://docbook.org/ns/docbook">
<title>アトリビュート</title>
@@ -59,43 +59,44 @@
class CopyFile implements ActionHandler
{
- public string $fileName;
- public string $targetDirectory;
+ public string $fileName;
+ public string $targetDirectory;
- #[SetUp]
- public function fileExists()
- {
- if (!file_exists($this->fileName)) {
- throw new RuntimeException("File does not exist");
- }
- }
+ #[SetUp]
+ public function fileExists()
+ {
+ if (!file_exists($this->fileName)) {
+ throw new RuntimeException("File does not exist");
+ }
+ }
- #[SetUp]
- public function targetDirectoryExists()
- {
- @mkdir($this->targetDirectory);
- }
+ #[SetUp]
+ public function targetDirectoryExists()
+ {
+ mkdir($this->targetDirectory);
+ }
- public function execute()
- {
- copy($this->fileName, $this->targetDirectory . '/' . basename($this->fileName));
- }
+ public function execute()
+ {
+ copy($this->fileName, $this->targetDirectory . '/' . basename($this->fileName));
+ }
}
-function executeAction(ActionHandler $actionHandler) {
- $reflection = new ReflectionObject($actionHandler);
+function executeAction(ActionHandler $actionHandler)
+{
+ $reflection = new ReflectionObject($actionHandler);
- foreach ($reflection->getMethods() as $method) {
- $attributes = $method->getAttributes(SetUp::class);
+ foreach ($reflection->getMethods() as $method) {
+ $attributes = $method->getAttributes(SetUp::class);
- if (count($attributes) > 0) {
- $methodName = $method->getName();
+ if (count($attributes) > 0) {
+ $methodName = $method->getName();
- $actionHandler->$methodName();
- }
- }
+ $actionHandler->$methodName();
+ }
+ }
- $actionHandler->execute();
+ $actionHandler->execute();
}
$copyAction = new CopyFile();