@@ -110,14 +110,14 @@ private function calculateYPosition() : int
110110 {
111111 $ lines = 5 ; //1. empty 2. prompt text 3. empty 4. input 5. empty
112112
113- return ceil ($ this ->parentMenu ->getCurrentFrame ()->count () / 2 ) - ceil ($ lines /2 ) + 1 ;
113+ return ( int ) ( ceil ($ this ->parentMenu ->getCurrentFrame ()->count () / 2 ) - ceil ($ lines /2 ) + 1 ) ;
114114 }
115115
116116 private function calculateYPositionWithError () : int
117117 {
118118 $ lines = 7 ; //1. empty 2. prompt text 3. empty 4. input 5. empty 6. error 7. empty
119119
120- return ceil ($ this ->parentMenu ->getCurrentFrame ()->count () / 2 ) - ceil ($ lines /2 ) + 1 ;
120+ return ( int ) ( ceil ($ this ->parentMenu ->getCurrentFrame ()->count () / 2 ) - ceil ($ lines /2 ) + 1 ) ;
121121 }
122122
123123 private function calculateXPosition (Input $ input , string $ userInput ) : int
@@ -134,7 +134,7 @@ private function calculateXPosition(Input $input, string $userInput) : int
134134 $ halfWidth = ($ width + ($ input ->getStyle ()->getPaddingLeftRight () * 2 )) / 2 ;
135135 $ parentHalfWidth = ceil ($ parentStyle ->getWidth () / 2 + $ parentStyle ->getMargin ());
136136
137- return $ parentHalfWidth - $ halfWidth ;
137+ return ( int ) ( $ parentHalfWidth - $ halfWidth) ;
138138 }
139139
140140 private function drawLine (Input $ input , string $ userInput , string $ text ) : void
@@ -164,8 +164,8 @@ private function drawCenteredLine(Input $input, string $userInput, string $text)
164164 );
165165
166166 $ textLength = mb_strlen (StringUtil::stripAnsiEscapeSequence ($ text ));
167- $ leftFill = ($ width / 2 ) - ($ textLength / 2 );
168- $ rightFill = ceil ($ width - $ leftFill - $ textLength );
167+ $ leftFill = (int ) (( $ width / 2 ) - ($ textLength / 2 ) );
168+ $ rightFill = ( int ) ceil ($ width - $ leftFill - $ textLength );
169169
170170 $ this ->drawLine (
171171 $ input ,
0 commit comments