| Conditions | 2 |
| Paths | 2 |
| Total Lines | 59 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 43 | private static function getAssetsIfNotIncluded() |
||
| 44 | { |
||
| 45 | if (!self::$assetsIncluded) { |
||
| 46 | self::$assetsIncluded = true; |
||
| 47 | return '<style> |
||
| 48 | .ccEditDocumentButton{ |
||
| 49 | opacity:0; |
||
| 50 | -webkit-transition: opacity 0.5s;-moz-transition: opacity 0.5s;-ms-transition: opacity 0.5s;-o-transition: opacity 0.5s;transition: opacity 0.5s; |
||
| 51 | } |
||
| 52 | |||
| 53 | .ccEditDocumentButton.active { |
||
| 54 | display:block; |
||
| 55 | position:absolute; |
||
| 56 | line-height:50px; |
||
| 57 | width:50px; |
||
| 58 | height:50px; |
||
| 59 | background: rgb(0, 106, 193) url("data:image/svg+xml;utf8,<svg width=\'25\' height=\'25\' viewBox=\'0 0 1792 1792\' xmlns=\'http://www.w3.org/2000/svg\'><path d=\'M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z\' fill=\'#fff\'/></svg>") no-repeat center; |
||
| 60 | border-radius:50%; |
||
| 61 | color:#fff; |
||
| 62 | font-family:Arial, sans-serif; |
||
| 63 | text-align:center; |
||
| 64 | cursor:pointer; |
||
| 65 | box-shadow: 5px 5px 5px rgba(128, 128, 128, 0.5); |
||
| 66 | z-index:255; |
||
| 67 | opacity:0.7; |
||
| 68 | } |
||
| 69 | |||
| 70 | .ccEditDocumentButton.active:hover { |
||
| 71 | color:rgb(0, 106, 193); |
||
| 72 | background: #fff url("data:image/svg+xml;utf8,<svg width=\'25\' height=\'25\' viewBox=\'0 0 1792 1792\' xmlns=\'http://www.w3.org/2000/svg\'><path d=\'M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z\' fill=\'#006AC1\'/></svg>") no-repeat center; |
||
| 73 | opacity:1; |
||
| 74 | } |
||
| 75 | |||
| 76 | .ccDocumentEditorHidden { |
||
| 77 | transform: translateX(100%); |
||
| 78 | } |
||
| 79 | |||
| 80 | @keyframes slideInFromRight { |
||
| 81 | 0% { |
||
| 82 | transform: translateX(100%); |
||
| 83 | } |
||
| 84 | 100% { |
||
| 85 | transform: translateX(0); |
||
| 86 | } |
||
| 87 | } |
||
| 88 | |||
| 89 | @keyframes slideOutToRight { |
||
| 90 | 0% { |
||
| 91 | transform: translateX(0); |
||
| 92 | } |
||
| 93 | 100% { |
||
| 94 | transform: translateX(100%); |
||
| 95 | } |
||
| 96 | } |
||
| 97 | </style>' . |
||
| 98 | '<script src="' . Request::$subfolders . 'js/cms.js"></script>'; |
||
| 99 | } |
||
| 100 | return ''; |
||
| 101 | } |
||
| 102 | } |
||
| 104 |