Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
S
sidekick
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Privat - Marco Schmiedel
sidekick
Commits
336a09ca
Commit
336a09ca
authored
Dec 23, 2021
by
Marco Schmiedel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix beautifer variable commands
parent
9b855a9d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
14 deletions
+49
-14
BeautifyManager.php
src/Managers/BeautifyManager/BeautifyManager.php
+49
-14
No files found.
src/Managers/BeautifyManager/BeautifyManager.php
View file @
336a09ca
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
| sidekick package.
| sidekick package.
|
|
| Author: Marco Schmiedel <marco.schmiedel@itmax.email>
| Author: Marco Schmiedel <marco.schmiedel@itmax.email>
| Date: 2021-12-23
19:59:15
| Date: 2021-12-23
21:21:03
|
|
*/
*/
namespace
Ceetrox\Managers\BeautifyManager
;
namespace
Ceetrox\Managers\BeautifyManager
;
...
@@ -32,12 +32,34 @@
...
@@ -32,12 +32,34 @@
{
{
/*
/*
|--------------------------------------------------------------------------------------------
|--------------------------------------------------------------------------------------------
|
Variables
|
Parameter
|--------------------------------------------------------------------------------------------
|--------------------------------------------------------------------------------------------
| This variable stores the content during the render process.
*/
*/
var
$content
=
[];
var
$content
=
[];
/*
|--------------------------------------------------------------------------------------------
| Parameter
|--------------------------------------------------------------------------------------------
| This variable stores the identified classes.
*/
var
$classes
=
[];
var
$classes
=
[];
/*
|--------------------------------------------------------------------------------------------
| Parameter
|--------------------------------------------------------------------------------------------
| This variable stores the identified comments.
*/
var
$comments
=
[];
var
$comments
=
[];
/*
|--------------------------------------------------------------------------------------------
| Parameter
|--------------------------------------------------------------------------------------------
| This is a working parameter for the renderer and contains the current line deph.
*/
var
$linedeph
=
1
;
var
$linedeph
=
1
;
...
@@ -215,13 +237,13 @@
...
@@ -215,13 +237,13 @@
|----------------------------------------------------------------------------------------
|----------------------------------------------------------------------------------------
| start Pattern
| start Pattern
*/
*/
$openPattern
=
'/[^A-Za-z]+[^(A-Za-z0-9);{}$*"]+class[^a-z\\\[(=-][^{;()[\]]+/s'
;
$openPattern
=
'/[^A-Za-z
:
]+[^(A-Za-z0-9);{}$*"]+class[^a-z\\\[(=-][^{;()[\]]+/s'
;
/*
/*
|----------------------------------------------------------------------------------------
|----------------------------------------------------------------------------------------
| stop Pattern
| stop Pattern
*/
*/
$closePattern
=
'/([^A-Za-z]+[^(A-Za-z0-9);{$}>*$()"]+\s*class[^a-z\\[(=-])|[\s\t\n]+$/'
;
$closePattern
=
'/([^A-Za-z
:
]+[^(A-Za-z0-9);{$}>*$()"]+\s*class[^a-z\\[(=-])|[\s\t\n]+$/'
;
/*
/*
|----------------------------------------------------------------------------------------
|----------------------------------------------------------------------------------------
...
@@ -264,7 +286,7 @@
...
@@ -264,7 +286,7 @@
| A check is then carried out to determine whether class variables are available.
| A check is then carried out to determine whether class variables are available.
| These will be noted later or set to "false".
| These will be noted later or set to "false".
*/
*/
$preg
=
preg_match_all
(
'/(
public|protected|private|var)\s*\$.*
\;/'
,
$Class
,
$variables
,
PREG_OFFSET_CAPTURE
);
$preg
=
preg_match_all
(
'/(
#COMMENT.*|\R|\s)*(public|protected|private|var)\s*\$(.|\R)+?
\;/'
,
$Class
,
$variables
,
PREG_OFFSET_CAPTURE
);
if
(
isset
(
$variables
[
0
]))
if
(
isset
(
$variables
[
0
]))
{
{
...
@@ -557,18 +579,31 @@
...
@@ -557,18 +579,31 @@
*/
*/
$this
->
linedeph
++
;
$this
->
linedeph
++
;
/*
|--------------------------------------------------------------------------------
| write title comment
*/
$classstream
.=
$this
->
writeComment
(
''
,
'Variables'
);
/*
/*
|--------------------------------------------------------------------------------
|--------------------------------------------------------------------------------
| setup variables
| setup variables
*/
*/
$classstream
.=
$this
->
s
()
.
implode
(
"
\n
"
.
$this
->
s
(),
$class
[
'variables'
]);
foreach
(
$class
[
'variables'
]
as
$variable
)
$classstream
.=
"
\n\n
"
;
{
$lines
=
explode
(
"
\n
"
,
$variable
);
foreach
(
$lines
as
$line
)
{
if
(
strlen
(
$line
)
>
0
)
{
if
(
substr
(
$line
,
0
,
8
)
==
'#COMMENT'
)
{
$comment
=
$this
->
getCommentFromPregMatch
(
'/#.+-.+-.+#/'
,
$line
);
$classstream
.=
$this
->
writeComment
(
$comment
,
'Parameter'
);
}
else
{
$classstream
.=
$this
->
s
()
.
$line
.
"
\n
"
;
}
}
}
$classstream
.=
"
\n
"
;
}
/*
/*
|--------------------------------------------------------------------------------
|--------------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment