File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -111,4 +111,12 @@ public function getChildrenTypes()
111111 {
112112 return array ();
113113 }
114+ /**
115+ * Always return null to avoid having value being detected as a potential function/method/variable
116+ * @see \WsdlToPhp\PhpGenerator\Element\AbstractAssignedValueElement::getScalarValue()
117+ */
118+ protected function getScalarValue ($ value )
119+ {
120+ return null ;
121+ }
114122}
Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ public function testGetPhpDeclarationNumberOneValue()
4444 $ this ->assertSame ('define( \'foo \', 1); ' , $ constant ->getPhpDeclaration ());
4545 }
4646
47+ public function testGetPhpDeclarationParenthesisValue ()
48+ {
49+ $ constant = new PhpConstant ('foo ' , 'NCSA Common (Apache default) ' );
50+
51+ $ this ->assertSame ('define( \'foo \', \'NCSA Common (Apache default) \'); ' , $ constant ->getPhpDeclaration ());
52+ }
53+
4754 /**
4855 * @expectedException InvalidArgumentException
4956 */
@@ -59,6 +66,13 @@ public function testGetPhpDeclarationNullValueForClass()
5966 $ this ->assertSame ('const FOO = null; ' , $ constant ->getPhpDeclaration ());
6067 }
6168
69+ public function testGetPhpDeclarationParenthesisValueForClass ()
70+ {
71+ $ constant = new PhpConstant ('foo ' , 'NCSA Common (Apache default) ' , new PhpClass ('bar ' ));
72+
73+ $ this ->assertSame ('const FOO = \'NCSA Common (Apache default) \'; ' , $ constant ->getPhpDeclaration ());
74+ }
75+
6276 public function testGetPhpDeclarationTrueValueForClass ()
6377 {
6478 $ constant = new PhpConstant ('foo ' , true , new PhpClass ('Bar ' ));
You can’t perform that action at this time.
0 commit comments