55 *
66 * @copyright Copyright (c) 2008 David Grudl
77 * @license New BSD License
8- * @version 1.2
8+ * @version 1.3
99 */
1010
1111use GuzzleHttp \Client ;
@@ -32,7 +32,7 @@ class Feed
3232 * @return Feed
3333 * @throws FeedException
3434 */
35- public static function load ($ url , $ user = NULL , $ pass = NULL )
35+ public static function load ($ url , $ user = null , $ pass = null )
3636 {
3737 $ xml = self ::loadXml ($ url , $ user , $ pass );
3838 if ($ xml ->channel ) {
@@ -51,7 +51,7 @@ public static function load($url, $user = NULL, $pass = NULL)
5151 * @return Feed
5252 * @throws FeedException
5353 */
54- public static function loadRss ($ url , $ user = NULL , $ pass = NULL )
54+ public static function loadRss ($ url , $ user = null , $ pass = null )
5555 {
5656 return self ::fromRss (self ::loadXml ($ url , $ user , $ pass ));
5757 }
@@ -65,7 +65,7 @@ public static function loadRss($url, $user = NULL, $pass = NULL)
6565 * @return Feed
6666 * @throws FeedException
6767 */
68- public static function loadAtom ($ url , $ user = NULL , $ pass = NULL )
68+ public static function loadAtom ($ url , $ user = null , $ pass = null )
6969 {
7070 return self ::fromAtom (self ::loadXml ($ url , $ user , $ pass ));
7171 }
@@ -98,8 +98,8 @@ private static function fromRss(SimpleXMLElement $xml)
9898
9999 private static function fromAtom (SimpleXMLElement $ xml )
100100 {
101- if (!in_array ('http://www.w3.org/2005/Atom ' , $ xml ->getDocNamespaces (), TRUE )
102- && !in_array ('http://purl.org/atom/ns# ' , $ xml ->getDocNamespaces (), TRUE )
101+ if (!in_array ('http://www.w3.org/2005/Atom ' , $ xml ->getDocNamespaces (), true )
102+ && !in_array ('http://purl.org/atom/ns# ' , $ xml ->getDocNamespaces (), true )
103103 ) {
104104 throw new FeedException ('Invalid feed. ' );
105105 }
@@ -142,9 +142,9 @@ public function __set($name, $value)
142142 * @param SimpleXMLElement
143143 * @return array
144144 */
145- public function toArray (SimpleXMLElement $ xml = NULL )
145+ public function toArray (SimpleXMLElement $ xml = null )
146146 {
147- if ($ xml === NULL ) {
147+ if ($ xml === null ) {
148148 $ xml = $ this ->xml ;
149149 }
150150
@@ -202,7 +202,7 @@ private static function loadXml($url, $user, $pass)
202202 * @param string
203203 * @param string
204204 * @param string
205- * @return string|FALSE
205+ * @return string|false
206206 * @throws FeedException
207207 */
208208 private static function httpRequest ($ url , $ user , $ pass )
@@ -229,14 +229,13 @@ private static function httpRequest($url, $user, $pass)
229229 */
230230 private static function adjustNamespaces ($ el )
231231 {
232- foreach ($ el ->getNamespaces (TRUE ) as $ prefix => $ ns ) {
232+ foreach ($ el ->getNamespaces (true ) as $ prefix => $ ns ) {
233233 $ children = $ el ->children ($ ns );
234234 foreach ($ children as $ tag => $ content ) {
235235 $ el ->{$ prefix . ': ' . $ tag } = $ content ;
236236 }
237237 }
238238 }
239-
240239}
241240
242241
0 commit comments