@@ -27,17 +27,17 @@ class Reader
2727{
2828 const TYPE_NATIVE = 'native ' ;
2929 const TYPE_EXIFTOOL = 'exiftool ' ;
30-
30+
3131 /**
3232 * The current adapter
3333 *
3434 * @var \PHPExif\Reader\AdapterInterface
3535 */
3636 protected $ adapter ;
37-
37+
3838 /**
3939 * Reader constructor
40- *
40+ *
4141 * @param \PHPExif\Reader\AdapterInterface $adapter
4242 */
4343 public function __construct (AdapterInterface $ adapter = null )
@@ -46,23 +46,23 @@ public function __construct(AdapterInterface $adapter = null)
4646 $ this ->setAdapter ($ adapter );
4747 }
4848 }
49-
49+
5050 /**
5151 * Setter for the reader adapter
52- *
52+ *
5353 * @param \PHPExif\Reader\AdapterInterface $adapter
5454 * @return \PHPExif\Reader Current instance for chaining
5555 */
5656 public function setAdapter (AdapterInterface $ adapter )
5757 {
5858 $ this ->adapter = $ adapter ;
59-
59+
6060 return $ this ;
6161 }
62-
62+
6363 /**
6464 * Getter for the reader adapter
65- *
65+ *
6666 * @return \PHPExif\Reader\AdapterInterface
6767 * @throws NoAdapterException When no adapter is set
6868 */
@@ -71,36 +71,38 @@ public function getAdapter()
7171 if (empty ($ this ->adapter )) {
7272 throw new NoAdapterException ('No adapter set in the reader ' );
7373 }
74-
74+
7575 return $ this ->adapter ;
7676 }
77-
77+
7878 /**
7979 * Factory for the reader
80- *
80+ *
8181 * @param string $type
8282 * @return \PHPExif\Reader
8383 * @throws \InvalidArgumentException When given type is invalid
8484 */
8585 public static function factory ($ type )
8686 {
8787 $ classname = get_called_class ();
88-
88+
89+ $ adapter = null ;
8990 switch ($ type ) {
9091 case self ::TYPE_NATIVE :
9192 $ adapter = new Reader \Adapter \Native ();
92- return new $ classname ( $ adapter ) ;
93+ break ;
9394 case self ::TYPE_EXIFTOOL :
9495 $ adapter = new Reader \Adapter \Exiftool ();
95- return new $ classname ( $ adapter ) ;
96+ break ;
9697 default :
9798 throw new \InvalidArgumentException (
9899 sprintf ('Unknown type "%1$s" ' , $ type )
99100 );
100101 break ;
101102 }
103+ return new $ classname ($ adapter );
102104 }
103-
105+
104106 /**
105107 * Reads & parses the EXIF data from given file
106108 *
0 commit comments