Skip to content

Commit 81ff750

Browse files
committed
Author class refactored
1 parent b76220a commit 81ff750

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

source/Author.php

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
/**
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2013 Tomáš Tatarko
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
9+
* this software and associated documentation files (the "Software"), to deal in
10+
* the Software without restriction, including without limitation the rights to
11+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12+
* the Software, and to permit persons to whom the Software is furnished to do so,
13+
* subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in all
16+
* copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24+
*/
25+
26+
namespace Presto;
27+
28+
/**
29+
* Simple wrapper class for authors of template
30+
* @package Presto
31+
* @author Tomas Tatarko <[email protected]>
32+
* @copyright (c) 2013, Tomas Tatarko
33+
* @link https://github.com/tatarko/Presto
34+
* @license http://choosealicense.com/licenses/mit/ The MIT License
35+
* @since 1.0
36+
* @property-read string $htmlLink Html link to author's homepage
37+
*/
38+
class Author extends Object
39+
{
40+
/**
41+
* Name of the author
42+
* @var string
43+
*/
44+
public $name;
45+
46+
/**
47+
* Homepage of the author
48+
* @var string
49+
*/
50+
public $url;
51+
52+
/**
53+
* Gets html link to author's homepage
54+
* @return string
55+
*/
56+
public function getHtmlLink()
57+
{
58+
return sprintf('<a href="%s">%s</a>', $this->url, $this->name);
59+
}
60+
}

0 commit comments

Comments
 (0)