Permalink
Browse files

Added License

  • Loading branch information...
1 parent 1bf40e6 commit 941e669dbe23521b71a8611cb155d7e2a49a18e4 @willdurand committed Nov 16, 2011
Showing with 58 additions and 1 deletion.
  1. +22 −0 LICENSE
  2. +8 −0 src/EmailReplyParser/Email.php
  3. +10 −0 src/EmailReplyParser/EmailReplyParser.php
  4. +18 −1 src/EmailReplyParser/Fragment.php
View
@@ -0,0 +1,22 @@
+The MIT License
+
+Copyright (c) GitHub, William Durand <william.durand1@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
@@ -1,5 +1,13 @@
<?php
+/**
+ * This file is part of the EmailReplyParser package.
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @license MIT License
+ */
+
namespace EmailReplyParser;
/**
@@ -1,5 +1,13 @@
<?php
+/**
+ * This file is part of the EmailReplyParser package.
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @license MIT License
+ */
+
namespace EmailReplyParser;
/**
@@ -8,6 +16,8 @@
class EmailReplyParser
{
/**
+ * Static method for convenient usage.
+ *
* @param string $text An email as text.
*
* @return array
@@ -1,5 +1,13 @@
<?php
+/**
+ * This file is part of the EmailReplyParser package.
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @license MIT License
+ */
+
namespace EmailReplyParser;
/**
@@ -28,6 +36,11 @@ class Fragment
protected $isQuoted = false;
/**
+ * @var string
+ */
+ protected $content = null;
+
+ /**
* @param string $firstLine
* @param boolean $quoted
*/
@@ -103,7 +116,11 @@ public function getLastLine()
*/
public function getContent()
{
- return preg_replace("/^\n/", '', strrev(implode("\n", $this->lines)));
+ if (null === $this->content) {
+ $this->content = preg_replace("/^\n/", '', strrev(implode("\n", $this->lines)));
+ }
+
+ return $this->content;
}
/**

0 comments on commit 941e669

Please sign in to comment.