Skip to content

Commit 38649ae

Browse files
author
alexrohleder96@outlook.com
committed
tab to space
1 parent 13719e1 commit 38649ae

9 files changed

+277
-277
lines changed

composer.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"name": "codeburner/annotator",
3-
"description": "Implements a simple, fast and useful annotation support.",
4-
"keywords": ["annotation", "codeburner"],
5-
"license": "MIT",
6-
"require": {
7-
"php": ">=5.5.0"
8-
},
9-
"authors": [
10-
{
11-
"name": "Alex Rohleder",
12-
"email": "alexrohleder96@outlook.com"
13-
}
14-
],
15-
"autoload": {
16-
"psr-4": {
17-
"Codeburner\\Annotator\\": "src"
18-
}
19-
},
20-
"require-dev": {
21-
"phpunit/phpunit": "~4.0"
22-
}
2+
"name": "codeburner/annotator",
3+
"description": "Implements a simple, fast and useful annotation support.",
4+
"keywords": ["annotation", "codeburner"],
5+
"license": "MIT",
6+
"require": {
7+
"php": ">=5.5.0"
8+
},
9+
"authors": [
10+
{
11+
"name": "Alex Rohleder",
12+
"email": "alexrohleder96@outlook.com"
13+
}
14+
],
15+
"autoload": {
16+
"psr-4": {
17+
"Codeburner\\Annotator\\": "src"
18+
}
19+
},
20+
"require-dev": {
21+
"phpunit/phpunit": "~4.0"
22+
}
2323
}

src/Annotation.php

Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -19,106 +19,106 @@
1919
class Annotation
2020
{
2121

22-
/**
23-
* The annotation token.
24-
*
25-
* @var string
26-
*/
27-
28-
protected $name;
29-
30-
/**
31-
* Formmated arguments, but not casted.
32-
*
33-
* @var array
34-
*/
35-
36-
protected $arguments;
37-
38-
/**
39-
* @param string $name
40-
* @param string $arguments
41-
*/
42-
43-
public function __construct($name, $arguments)
44-
{
45-
$this->name = $name;
46-
47-
if (strpos($arguments, "{") === 0) {
48-
$this->arguments = (array) json_decode($arguments, true);
49-
} else $this->arguments = (array) trim($arguments);
50-
51-
$this->filter();
52-
}
53-
54-
/**
55-
* @return string
56-
*/
57-
58-
public function getName()
59-
{
60-
return $this->name;
61-
}
62-
63-
/**
64-
* @return array
65-
*/
66-
67-
public function getArguments()
68-
{
69-
return $this->arguments;
70-
}
71-
72-
/**
73-
* @return string
74-
*/
75-
76-
public function getArgument($name)
77-
{
78-
return isset($this->arguments[$name]) ? $this->arguments[$name] : null;
79-
}
80-
81-
/**
82-
* @return string
83-
*/
84-
85-
public function getArgumentCount()
86-
{
87-
return count($this->arguments);
88-
}
89-
90-
/**
91-
* @return boolean
92-
*/
93-
94-
public function hasArgument($name)
95-
{
96-
return isset($this->arguments[$name]);
97-
}
98-
99-
/**
100-
* Overwrite this method to parse and validate the arguments in a
101-
* new Annotation definition.
102-
*
103-
* @return void
104-
*/
105-
106-
protected function filter()
107-
{
108-
// void
109-
}
110-
111-
/**
112-
* @return string
113-
*/
114-
115-
public function __toString()
116-
{
117-
if (count($this->arguments) === 1) {
118-
return (string) $this->arguments[0];
119-
}
120-
121-
throw new Exceptions\AnnotationException("The annotation cannot be converted to string.");
122-
}
22+
/**
23+
* The annotation token.
24+
*
25+
* @var string
26+
*/
27+
28+
protected $name;
29+
30+
/**
31+
* Formmated arguments, but not casted.
32+
*
33+
* @var array
34+
*/
35+
36+
protected $arguments;
37+
38+
/**
39+
* @param string $name
40+
* @param string $arguments
41+
*/
42+
43+
public function __construct($name, $arguments)
44+
{
45+
$this->name = $name;
46+
47+
if (strpos($arguments, "{") === 0) {
48+
$this->arguments = (array) json_decode($arguments, true);
49+
} else $this->arguments = (array) trim($arguments);
50+
51+
$this->filter();
52+
}
53+
54+
/**
55+
* @return string
56+
*/
57+
58+
public function getName()
59+
{
60+
return $this->name;
61+
}
62+
63+
/**
64+
* @return array
65+
*/
66+
67+
public function getArguments()
68+
{
69+
return $this->arguments;
70+
}
71+
72+
/**
73+
* @return string
74+
*/
75+
76+
public function getArgument($name)
77+
{
78+
return isset($this->arguments[$name]) ? $this->arguments[$name] : null;
79+
}
80+
81+
/**
82+
* @return string
83+
*/
84+
85+
public function getArgumentCount()
86+
{
87+
return count($this->arguments);
88+
}
89+
90+
/**
91+
* @return boolean
92+
*/
93+
94+
public function hasArgument($name)
95+
{
96+
return isset($this->arguments[$name]);
97+
}
98+
99+
/**
100+
* Overwrite this method to parse and validate the arguments in a
101+
* new Annotation definition.
102+
*
103+
* @return void
104+
*/
105+
106+
protected function filter()
107+
{
108+
// void
109+
}
110+
111+
/**
112+
* @return string
113+
*/
114+
115+
public function __toString()
116+
{
117+
if (count($this->arguments) === 1) {
118+
return (string) $this->arguments[0];
119+
}
120+
121+
throw new Exceptions\AnnotationException("The annotation cannot be converted to string.");
122+
}
123123

124124
}

src/Exceptions/BadAnnotationException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
class BadAnnotationException extends AnnotationException
2020
{
2121

22-
public function __construct($annotation)
23-
{
24-
parent::__construct("The `$annotation` annotation was used wrong. Please check the arguments.");
25-
}
22+
public function __construct($annotation)
23+
{
24+
parent::__construct("The `$annotation` annotation was used wrong. Please check the arguments.");
25+
}
2626

2727
}

src/Exceptions/WildcardNotAllowedException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
class WildcardNotAllowedException extends AnnotationException
2121
{
2222

23-
public function __construct($method)
24-
{
25-
parent::__construct("Annotator method `$method` does not allow wildcards in annotation name.");
26-
}
23+
public function __construct($method)
24+
{
25+
parent::__construct("Annotator method `$method` does not allow wildcards in annotation name.");
26+
}
2727

2828
}

0 commit comments

Comments
 (0)